bundlewrap/bundles/vnstat/metadata.py

50 lines
1 KiB
Python
Raw Permalink Normal View History

defaults = {
'apt': {
'packages': {
'vnstat': {},
'vnstati': {},
},
},
'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',
},
},
},
'vnstat': {
'bandwidth': '1000',
},
}
@metadata_reactor.provides(
'vnstat/interface',
)
def get_default_interface(metadata):
interfaces = sorted(metadata.get('interfaces', {}).keys())
2021-02-12 19:37:36 +00:00
if interfaces:
return {
'vnstat': {
'interface': interfaces[0],
},
}
return {}