bundles/routeros: this does not need to be a metadata reactor

This commit is contained in:
Franzi 2024-06-22 20:39:04 +02:00
parent d1f182607d
commit b72d82b894
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -2,30 +2,7 @@ import re
from json import load
from os.path import join
defaults = {
'icinga2_api': {
'routeros': {
'services': {
'TEMPERATURE': {
'check_command': 'snmp',
'vars.snmp_oid': '1.3.6.1.4.1.14988.1.1.3.11.0',
'vars.snmp_version': '2c',
'vars.snmp_community': 'public',
'vars.warn': '@750:799', # 1/10 °C
'vars.crit': '@800:9999',
},
},
},
},
}
@metadata_reactor.provides(
'routeros/ips',
'routeros/ports',
'routeros/vlans',
)
def get_ports_from_netbox_dump(metadata):
with open(join(repo.path, 'configs', 'netbox', f'{node.name}.json')) as f:
netbox = load(f)
@ -104,12 +81,26 @@ def get_ports_from_netbox_dump(metadata):
if conf['ips']:
vlans[vlan]['tagged'].add('bridge')
return {
defaults = {
'icinga2_api': {
'routeros': {
'services': {
'TEMPERATURE': {
'check_command': 'snmp',
'vars.snmp_oid': '1.3.6.1.4.1.14988.1.1.3.11.0',
'vars.snmp_version': '2c',
'vars.snmp_community': 'public',
'vars.warn': '@750:799', # 1/10 °C
'vars.crit': '@800:9999',
},
},
},
},
'routeros': {
'ips': ips,
'ports': ports,
'vlans': vlans,
}
},
}