bundles/netdata: introduce, add to home.nas and home.router
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
ff607777ce
commit
1339564dc4
5 changed files with 66 additions and 0 deletions
14
bundles/netdata/files/netdata.conf
Normal file
14
bundles/netdata/files/netdata.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
[global]
|
||||
run as user = netdata
|
||||
hostname = ${node.name}
|
||||
memory mode = dbengine
|
||||
page cache size = 128
|
||||
dbengine multihost disk space = 2048
|
||||
|
||||
[web]
|
||||
web files owner = root
|
||||
web files group = root
|
||||
bind to = 0.0.0.0
|
||||
|
||||
[registry]
|
||||
enabled = no
|
17
bundles/netdata/items.py
Normal file
17
bundles/netdata/items.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
files = {
|
||||
'/etc/netdata/netdata.conf': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:netdata:restart',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'netdata': {
|
||||
'needs': {
|
||||
'pkg_apt:netdata',
|
||||
'file:/etc/netdata/netdata.conf',
|
||||
},
|
||||
},
|
||||
}
|
28
bundles/netdata/metadata.py
Normal file
28
bundles/netdata/metadata.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'netdata': {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor
|
||||
def iptables(metadata):
|
||||
interfaces = metadata.get('netdata/restrict_to_interfaces', set())
|
||||
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,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -2,6 +2,7 @@ nodes['home.nas'] = {
|
|||
'hostname': '172.19.138.20',
|
||||
'bundles': {
|
||||
'backup-server',
|
||||
'netdata',
|
||||
'nfs-server',
|
||||
'vmhost',
|
||||
'zfs',
|
||||
|
|
|
@ -4,6 +4,7 @@ nodes['home.router'] = {
|
|||
'hostname': '172.19.138.1',
|
||||
'bundles': {
|
||||
'iptables',
|
||||
'netdata',
|
||||
'pppd',
|
||||
'radvd',
|
||||
'dhcpd',
|
||||
|
@ -52,6 +53,11 @@ nodes['home.router'] = {
|
|||
'nameservers': atomic({
|
||||
'9.9.9.10',
|
||||
}),
|
||||
'netdata': {
|
||||
'restrict-to-interfaces': {
|
||||
'enp1s0.42',
|
||||
},
|
||||
},
|
||||
'radvd': {
|
||||
'integrate-with-pppd': True,
|
||||
'interfaces': {
|
||||
|
|
Loading…
Reference in a new issue