wireguard-zabbix
is a Zabbix template to monitor Wireguard peers on Linux. It automatically discovers all your Wireguard peers and collects incoming/outgoing traffic usage.
This template assumes you have installed Wireguard with wireguard-install.sh
script (see this repo). It should work with vanilla Wireguard, but I didn't test it.
The instructions below are valid for Debian/Ubuntu but the principle should be applicable for other Linuxes as well.
zabbix
to /etc/sudoers.d
with the following line:
zabbix ALL=(root) NOPASSWD: /usr/bin/wg
zabbix
for /etc/wireguard/wg0.conf
:
setfacl -m 'u:zabbix:--x' /etc/wireguard
setfacl -m 'u:zabbix:r--' /etc/wireguard/wg0.conf
user_parameters.conf
to /etc/zabbix/zabbix_agentd.d
:
UserParameter=wireguard.peers,/usr/share/zabbix/wg-json-zbx
wg-json-zbx
(based on wg-json) from this repo to /usr/share/zabbix
, make sure it's readable by the user zabbix
service zabbix-agent restart