Netdata + WireGuard monitor, setup

Hi all.

I have little experience, I can not configure the WireGuard monitor through Netdata, but I heard that there is such an opportunity.

There is an instruction:

But she did not help me, and I did not find other topics of discussion.

What I wanted: thought that Netdata can track the number of connected WireGuard clients and the traffic on them.

But using the command from the instructions, nothing happened.
sudo setcap CAP_NET_ADMIN+epi /opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin

On my Debian 11 server, Netdata is installed according to the instructions:
wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --stable-channel --disable-telemetry --claim-token YOUR_CLAIM_TOKEN

Installed WireGuard manually (without Docker and other things) and set it up manually, it works.
apt install wireguard

Please how to connect Netdata + WireGuard for monitoring?

Hi, @Sagidullin. All capabilities are set automatically during Netdata installation. There should be no need to do that manually.

Can you show

sudo getcap /usr/libexec/netdata/plugins.d/go.d.plugin

And

sudo su -s /bin/bash netdata
/usr/libexec/netdata/plugins.d/go.d.plugin -d -m wireguard

Thank you, @ilyam8.

I want to say right away that along this path:
/usr/libexec/netdata/plugins.d/go.d.plugin, there was nothing. I made a “go.d.plugin” file, this file is empty.
The file “go.d.plugin” was found along the path:
/opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin

Here is the output from the first command:

root@Schrodinger:~# sudo getcap /usr/libexec/netdata/plugins.d/go.d.plugin
/usr/libexec/netdata/plugins.d/go.d.plugin cap_net_admin=eip
root@Schrodinger:~# sudo getcap /opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin
/opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin cap_net_admin=eip

The second command either does nothing, or is not quite correct, no result.

Ok, if you have installed Netdata in /opt/netdata/

sudo su -s /bin/bash netdata
/opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin -d -m wireguard

Installation at the specified address was automatic, I did not configure anything myself.

Introduced a new command, so that it should happen?

root@Schrodinger:~# sudo su -s /bin/bash netdata
/opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin -d -m wireguard

netdata@Schrodinger:/root$

As if nothing had happened.

P.S. I immediately forgot to say, I installed the WireGuard after Netdate.

It is running the plugin in debug mode

I don’t know why you have no output when you run it.

netdata@pve-deb-work:/home/ilyam$ /opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin -d -m wireguard
[ DEBUG ] main[main] main.go:114 plugin: name=go.d, version=v0.52.0
[ DEBUG ] main[main] main.go:116 current user: name=netdata, uid=998
[ INFO  ] main[main] agent.go:140 instance is started
[ INFO  ] main[main] setup.go:43 loading config file
[ INFO  ] main[main] setup.go:51 looking for 'go.d.conf' in [/etc/netdata /usr/lib/netdata/conf.d]
[ WARN  ] main[main] setup.go:55 couldn't find config, will use defaults
[ INFO  ] main[main] agent.go:144 using config: enabled 'true', default_run 'true', max_procs '0'
[ INFO  ] main[main] setup.go:70 loading modules
[ INFO  ] main[main] setup.go:89 enabled/registered modules: 1/80
[ INFO  ] main[main] setup.go:94 building discovery config
[ INFO  ] main[main] setup.go:141 looking for 'wireguard.conf' in [/etc/netdata/go.d /usr/lib/netdata/conf.d/go.d]
[ INFO  ] main[main] setup.go:154 couldn't find 'wireguard' module config, will use default config
[ INFO  ] main[main] setup.go:162 dummy/read/watch paths: 1/0/0
[ INFO  ] discovery[manager] manager.go:92 registered discoverers: [dummy discovery]
[ INFO  ] main[main] setup.go:176 looking for 'vnodes/' in [/etc/netdata /usr/lib/netdata/conf.d]
[ INFO  ] discovery[manager] manager.go:97 instance is started
[ INFO  ] build[manager] build.go:117 instance is started
[ INFO  ] run[manager] run.go:32 instance is started
[ INFO  ] discovery[dummy] discovery.go:52 instance is started
[ INFO  ] discovery[dummy] discovery.go:53 instance is stopped
[ DEBUG ] build[manager] build.go:164 received config group ('wireguard'): 1 jobs (added: 1, removed: 0)
[ DEBUG ] build[manager] build.go:313 building wireguard[wireguard] job, config: map[__provider__:dummy __source__:wireguard autodetection_retry:0 module:wireguard name:wireguard priority:70000 update_every:1]
[ INFO  ] wireguard[wireguard] collect.go:29 no WireGuard devices found on the host system
[ ERROR ] wireguard[wireguard] job.go:205 check failed
[ DEBUG ] run[manager] run.go:43 tick 0
^C[ INFO  ] main[main] agent.go:108 received interrupt signal (2). Terminating...
[ INFO  ] discovery[manager] manager.go:98 instance is stopped
[ INFO  ] run[manager] run.go:33 instance is stopped
[ INFO  ] build[manager] build.go:118 instance is sto

What if you run it without -m wireguard

/opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin -d

@ilyam8, thanks for the help!

Didn’t have time to try the last tip.
On the test server, I installed WireGuard first, NetData second, and it all worked!

Question: can I somehow change the captions of the graphs to make it easier to understand which client consumes more? Now chart names are Public Key.

Hi, @Sagidullin. What is a “client”? I am not a specialist, but from what I know there is no such concept as “users” and the client is represented as a peer on the server side with the relevant public key of the client.

Netdata has per-peer charts:

  • peer_network_io
  • peer_latest_handshake_ago

@ilyam8 , are absolutely right, I meant “peer” (peer_network_io , in my picture above).
The name peer is given by the Public key.
Is it possible to somehow give your own names for peer, so that it is more convenient to see the data in the picture?

@Sagidullin unfortunately, it is not possible.

1 Like