bundles/powerdns: add monitoring

This commit is contained in:
Franzi 2020-11-21 18:55:34 +01:00
parent 2fdeeca9c3
commit e6acda1f52
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -9,6 +9,15 @@ defaults = {
'pdns-backend-pgsql': {},
},
},
'icinga2_api': {
'powerdns': {
'services': {
'POWERDNS PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C pdns_server -c 1:',
},
},
},
},
'powerdns': {
'api_key': repo.vault.password_for('{} powerdns api'.format(node.name)),
},
@ -27,6 +36,24 @@ defaults = {
}
@metadata_reactor
def monitoring_for_primary_nameserver(metadata):
if metadata.get('powerdns/is_secondary', False):
return {}
return {
'icinga2_api': {
'powerdns': {
'services': {
'POWERDNS WEB INTERFACE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_http_url_for_string http://localhost:8081/ "PowerDNS"',
},
},
},
},
}
@metadata_reactor
def get_ips_of_secondary_nameservers(metadata):
if metadata.get('powerdns/is_secondary', False):