NAME
Monitoring::Sneck::Checks::wireguard - checks WireGuard peers have handshaken recently
VERSION
Version 0.0.1
SYNOPSIS
wireguard|perl:wireguard
wireguard_wg0|perl:wireguard -i wg0 -w 180 -c 600
wireguard_hub|perl:wireguard -k
wireguard_site|perl:wireguard -p 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='
DESCRIPTION
Checks how long ago each peer last handshook, through wg show all dump. A peer with traffic, or persistent keepalive, handshakes about every two minutes, so a old handshake means the tunnel is down.
A peer without persistent keepalive only handshakes when there is traffic, so a idle one looks the same as a down one. --keepalive checks only peers with it, for hubs with peers that come and go.
- CRITICAL :: A handshake older than --critical, or never made. A interface or peer given that is not there.
- WARNING :: A handshake older than --warning.
- UNKNOWN :: wg not being there, or failing, as it does when not run as root.
- OK :: Everything else, including no WireGuard interfaces.
Peers are named by interface and first allowed IP, or the start of their public key if they have none. A line for each peer follows the status line, with its endpoint, handshake, and transfer. Private and preshared keys are never output.
OPTIONS
- -i, --interface :: A interface to check, instead of all of them. May be given more than once.
- -p, --peer :: The public key of a peer to check, instead of all of them. May be given more than once.
- -k, --keepalive :: Only check peers with persistent keepalive.
- -w, --warning :: Range for the seconds since the latest handshake. Default :: 300
- -c, --critical :: Range for the seconds since the latest handshake. Default :: 900
METHODS
check
Does the check.