Skip to content

Commit

Permalink
fixes issue #185
Browse files Browse the repository at this point in the history
  • Loading branch information
gurubert committed Jan 14, 2025
1 parent a857c45 commit ae45d93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wireguard/lib/check_mk/base/plugins/agent_based/wireguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ def discover_wireguard(section) -> DiscoveryResult:
for interface, peers in section.items():
yield Service(item='%s' % interface)
for peer, data in peers.items():
yield Service(item='%s Peer %s' % (interface, peer),
parameters={'allowed-ips': data['allowed-ips']})
yield Service(item='%s Peer %s' % (interface, peer))

def check_wireguard(item, params, section):

Expand Down Expand Up @@ -120,6 +119,8 @@ def check_wireguard(item, params, section):
since = now - data['latest-handshake']
if since < timeout_warn or since < timeout_crit:
activepeers += 1
if timeout_warn < 0 and timeout_crit < 0:
activepeers += 1
yield Result(state=State.OK,
summary="%d configured peer(s)" % numpeers)
yield Metric('configured_vpn_tunnels', numpeers)
Expand Down
Binary file removed wireguard/wireguard-1.6.0.mkp
Binary file not shown.
Binary file added wireguard/wireguard-1.6.1.mkp
Binary file not shown.

0 comments on commit ae45d93

Please sign in to comment.