bundles/wireguard: add exclude_from_monitoring option for wireguard peers

This commit is contained in:
Franzi 2021-02-14 21:35:37 +01:00
parent 69605acfc9
commit 56fce7d460
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -87,6 +87,9 @@ def icinga2(metadata):
services = {} services = {}
for peer, config in metadata.get('wireguard/peers', {}).items(): for peer, config in metadata.get('wireguard/peers', {}).items():
if config.get('exclude_from_monitoring', False):
continue
services[f'WIREGUARD CONNECTION {peer}'] = { services[f'WIREGUARD CONNECTION {peer}'] = {
'command_on_monitored_host': config['pubkey'].format_into('sudo /usr/local/share/icinga/plugins/check_wireguard_connected wg0 {}'), 'command_on_monitored_host': config['pubkey'].format_into('sudo /usr/local/share/icinga/plugins/check_wireguard_connected wg0 {}'),
} }