2020-11-14 13:05:28 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'netdata': {},
|
|
|
|
},
|
|
|
|
},
|
2020-12-21 08:50:15 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'netdata': {
|
|
|
|
'services': {
|
|
|
|
'NETDATA PROCESS': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C netdata -c 1:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-11-14 13:05:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor
|
|
|
|
def iptables(metadata):
|
2020-11-15 12:25:15 +00:00
|
|
|
interfaces = metadata.get('netdata/restrict-to-interfaces', set())
|
2020-11-14 13:05:28 +00:00
|
|
|
iptables = []
|
|
|
|
|
|
|
|
if len(interfaces):
|
|
|
|
for iface in sorted(interfaces):
|
|
|
|
iptables.append(f'iptables -A INPUT -i {iface} -p tcp --dport 19999 -j ACCEPT')
|
|
|
|
|
|
|
|
else:
|
|
|
|
iptables.append('iptables -A INPUT -p tcp --dport 19999 -j ACCEPT')
|
|
|
|
|
|
|
|
return {
|
|
|
|
'iptables': {
|
|
|
|
'bundle_rules': {
|
|
|
|
'netdata': iptables,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|