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())
|
2021-02-12 19:37:36 +00:00
|
|
|
rules = []
|
2020-11-14 13:05:28 +00:00
|
|
|
|
2021-02-12 19:37:36 +00:00
|
|
|
if interfaces:
|
2020-11-14 13:05:28 +00:00
|
|
|
for iface in sorted(interfaces):
|
2021-02-12 19:37:36 +00:00
|
|
|
rules.append(f'iptables_both -A INPUT -i {iface} -p tcp --dport 19999 -j ACCEPT')
|
2020-11-14 13:05:28 +00:00
|
|
|
|
|
|
|
else:
|
2021-02-12 19:37:36 +00:00
|
|
|
rules.append('iptables_both -A INPUT -p tcp --dport 19999 -j ACCEPT')
|
2020-11-14 13:05:28 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
'iptables': {
|
|
|
|
'bundle_rules': {
|
2021-02-12 19:37:36 +00:00
|
|
|
'netdata': rules,
|
2020-11-14 13:05:28 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|