bundles/{netdata,pppd,radvd,vmhost,vnstat,wide-dhcp6c}: add monitoring
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-12-21 09:50:15 +01:00
parent 9d3d0bcc69
commit 5935aed0db
Signed by: kunsi
GPG key ID: 12E3D2136B818350
8 changed files with 100 additions and 0 deletions

View file

@ -4,6 +4,15 @@ defaults = {
'netdata': {}, 'netdata': {},
}, },
}, },
'icinga2_api': {
'netdata': {
'services': {
'NETDATA PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C netdata -c 1:',
},
},
},
},
} }

View file

@ -0,0 +1,28 @@
#!/bin/bash
statusfile="/var/tmp/dyndns.monitoring"
if ! [[ -f "$statusfile" ]]
then
echo "Status file not found"
exit 3
fi
mtime=$(stat -c %Y $statusfile)
now=$(date +%s)
if (( $now - $mtime > 60*60*24*8 ))
then
echo "Status file is older than 8 days!"
exit 3
fi
statuscode=$(cat $statusfile)
case "$statuscode" in
200)
echo "OK"
exit 0
;;
*)
echo "Last statuscode was $statuscode"
exit 2
;;
esac

View file

@ -84,6 +84,9 @@ files = {
'/usr/local/bin/restart-pppoe-if-no-public-ip': { '/usr/local/bin/restart-pppoe-if-no-public-ip': {
'mode': '0755', 'mode': '0755',
}, },
'/usr/local/share/icinga/plugins/check_dyndns_update': {
'mode': '0755',
},
} }
if 'dyndns' in node.metadata['pppd']: if 'dyndns' in node.metadata['pppd']:

View file

@ -11,4 +11,34 @@ defaults = {
'cron': { 'cron': {
'restart-pppoe-if-no-public-ip': '*/5 * * * * root /usr/local/bin/restart-pppoe-if-no-public-ip', 'restart-pppoe-if-no-public-ip': '*/5 * * * * root /usr/local/bin/restart-pppoe-if-no-public-ip',
}, },
'icinga2_api': {
'pppd': {
'services': {
'PPPD PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C pppd -c 1:',
},
'PPPOE PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C pppoe -c 1:',
},
},
},
},
} }
@metadata_reactor
def icinga_dyndns(metadata):
if 'dyndns' not in metadata.get('pppd'):
return {}
return {
'icinga2_api': {
'pppd': {
'services': {
'DYNDNS UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_dyndns_update',
},
},
},
},
}

View file

@ -4,6 +4,15 @@ defaults = {
'radvd': {}, 'radvd': {},
}, },
}, },
'icinga2_api': {
'radvd': {
'services': {
'RADVD PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C radvd -c 1:',
},
},
},
},
} }
if node.has_bundle('pppd'): if node.has_bundle('pppd'):

View file

@ -10,6 +10,9 @@ defaults = {
'icinga2_api': { 'icinga2_api': {
'vmhost': { 'vmhost': {
'services': { 'services': {
'LIBVIRT PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C libvirtd -c 1:',
},
'QEMU VM STATUS': { 'QEMU VM STATUS': {
'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_vm_status', 'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_vm_status',
'vars.notification.mail': True, 'vars.notification.mail': True,

View file

@ -5,6 +5,15 @@ defaults = {
'vnstati': {}, 'vnstati': {},
}, },
}, },
'icinga2_api': {
'vnstat': {
'services': {
'VNSTATD PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C vnstatd -c 1:',
},
},
},
},
'vnstat': { 'vnstat': {
'bandwidth': '1000', 'bandwidth': '1000',
}, },

View file

@ -12,6 +12,15 @@ defaults = {
], ],
}, },
}, },
'icinga2_api': {
'wide-dhcp6c': {
'services': {
'WIDE-DHCP6CD PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C dhcp6c -c 1:',
},
},
},
},
'wide-dhcp6c': { 'wide-dhcp6c': {
'subnet_len': '8', 'subnet_len': '8',
}, },