2020-11-13 20:41:02 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'ppp': {},
|
|
|
|
'pppoe': {},
|
2020-11-14 11:46:19 +00:00
|
|
|
'python3-requests': {},
|
2020-12-10 15:14:17 +00:00
|
|
|
'python3-netifaces': {},
|
2020-11-14 11:11:51 +00:00
|
|
|
'ndisc6': {},
|
2020-11-13 20:41:02 +00:00
|
|
|
},
|
|
|
|
},
|
2020-12-10 15:14:17 +00:00
|
|
|
'cron': {
|
2022-02-05 10:41:41 +00:00
|
|
|
'jobs': {
|
|
|
|
'restart-pppoe-if-no-public-ip': '*/5 * * * * root /usr/local/bin/restart-pppoe-if-no-public-ip',
|
|
|
|
},
|
2020-12-10 15:14:17 +00:00
|
|
|
},
|
2020-12-21 08:50:15 +00:00
|
|
|
'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:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-13 20:41:02 +00:00
|
|
|
}
|
2020-12-21 08:50:15 +00:00
|
|
|
|
|
|
|
|
2022-12-11 16:42:08 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'interfaces',
|
|
|
|
)
|
|
|
|
def ignore_interface(metadata):
|
|
|
|
return {
|
|
|
|
'interfaces': {
|
|
|
|
metadata.get('pppd/interface'): {
|
|
|
|
'ignore': True,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'icinga2_api/pppd/services',
|
|
|
|
)
|
2020-12-21 08:50:15 +00:00
|
|
|
def icinga_dyndns(metadata):
|
2021-08-14 05:55:01 +00:00
|
|
|
if not metadata.get('pppd/dyndns', {}):
|
2020-12-21 08:50:15 +00:00
|
|
|
return {}
|
|
|
|
|
|
|
|
return {
|
|
|
|
'icinga2_api': {
|
|
|
|
'pppd': {
|
|
|
|
'services': {
|
|
|
|
'DYNDNS UPDATE': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_dyndns_update',
|
2021-08-14 05:55:01 +00:00
|
|
|
'vars.notification.mail': True,
|
2020-12-21 08:50:15 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|