2022-02-06 12:39:52 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'icinga2_api/systemd-timers/services',
|
|
|
|
)
|
|
|
|
def monitoring(metadata):
|
|
|
|
services = {}
|
|
|
|
|
|
|
|
for timer, config in node.metadata.get('systemd-timers/timers', {}).items():
|
2023-07-13 19:31:25 +00:00
|
|
|
if (
|
|
|
|
config.get('delete', False)
|
|
|
|
or config.get('exclude_from_monitoring', False)
|
|
|
|
):
|
2022-02-06 12:39:52 +00:00
|
|
|
continue
|
|
|
|
|
|
|
|
services[f'SYSTEMD-TIMER {timer}'] = {
|
|
|
|
'command_on_monitored_host': f'/usr/local/share/icinga/plugins/check_systemd_timer {timer}',
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
'icinga2_api': {
|
|
|
|
'systemd-timers': {
|
|
|
|
'services': services,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|