2020-11-16 15:33:26 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'vnstat': {},
|
|
|
|
'vnstati': {},
|
|
|
|
},
|
|
|
|
},
|
2020-12-21 08:50:15 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'vnstat': {
|
|
|
|
'services': {
|
|
|
|
'VNSTATD PROCESS': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C vnstatd -c 1:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-12-12 06:56:23 +00:00
|
|
|
'nginx': {
|
|
|
|
'vhosts': {
|
|
|
|
'vnstat': {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'systemd-timers': {
|
|
|
|
'timers': {
|
|
|
|
'vnstat-generate-vnstati': {
|
|
|
|
'when': '*:0/10',
|
|
|
|
'command': '/usr/local/bin/generate-vnstati',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-16 15:33:26 +00:00
|
|
|
'vnstat': {
|
|
|
|
'bandwidth': '1000',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'vnstat/interface',
|
|
|
|
)
|
2020-11-16 15:33:26 +00:00
|
|
|
def get_default_interface(metadata):
|
|
|
|
interfaces = sorted(metadata.get('interfaces', {}).keys())
|
|
|
|
|
2021-02-12 19:37:36 +00:00
|
|
|
if interfaces:
|
2020-11-16 15:33:26 +00:00
|
|
|
return {
|
|
|
|
'vnstat': {
|
|
|
|
'interface': interfaces[0],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|