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
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'iptables/bundle_rules/netdata',
|
|
|
|
)
|
2020-11-14 13:05:28 +00:00
|
|
|
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):
|
2021-01-02 15:19:55 +00:00
|
|
|
iptables.append(f'iptables_both -A INPUT -i {iface} -p tcp --dport 19999 -j ACCEPT')
|
2020-11-14 13:05:28 +00:00
|
|
|
|
|
|
|
else:
|
2021-01-02 15:19:55 +00:00
|
|
|
iptables.append('iptables_both -A INPUT -p tcp --dport 19999 -j ACCEPT')
|
2020-11-14 13:05:28 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
'iptables': {
|
|
|
|
'bundle_rules': {
|
|
|
|
'netdata': iptables,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|