add bundle:systemd-timers
This commit is contained in:
parent
2a3a26c333
commit
0599c4dae0
7 changed files with 145 additions and 0 deletions
21
bundles/systemd-timers/metadata.py
Normal file
21
bundles/systemd-timers/metadata.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
@metadata_reactor.provides(
|
||||
'icinga2_api/systemd-timers/services',
|
||||
)
|
||||
def monitoring(metadata):
|
||||
services = {}
|
||||
|
||||
for timer, config in node.metadata.get('systemd-timers/timers', {}).items():
|
||||
if config.get('delete', False):
|
||||
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,
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue