- Joined
- Nov 25, 2013
- Messages
- 7,776
Hi all,
ever since I started to put more and more VMs in production (private projects, production nonetheless) I wanted to turn the various netdata installations on all the nodes into a collector-master setup. So the FreeNAS becomes the central instance and all the VMs just run headless collectors.
If you are in a simple LAN behind a firewall where all the machines trust each other, the configuration of the netdata service is dead easy, see:
https://docs.netdata.cloud/streaming/
Only problem: you cannot persistently configure netdata on FreeNAS (yet).
So I came up with this post-init task:
Then on the headless collectors add this to netdata.conf:
and this to stream.conf:
Insert a newly created GUID (
Done :)
Kind regards,
Patrick
ever since I started to put more and more VMs in production (private projects, production nonetheless) I wanted to turn the various netdata installations on all the nodes into a collector-master setup. So the FreeNAS becomes the central instance and all the VMs just run headless collectors.
If you are in a simple LAN behind a firewall where all the machines trust each other, the configuration of the netdata service is dead easy, see:
https://docs.netdata.cloud/streaming/
Only problem: you cannot persistently configure netdata on FreeNAS (yet).
So I came up with this post-init task:
Code:
#!/bin/sh
NETDATA_CONF="/usr/local/etc/netdata/netdata.conf"
STREAM_CONF="/usr/local/etc/netdata/stream.conf"
GUID="047cf4d3-5170-11e9-a22c-0cc47afa3c72"
MYHOSTNAME="FreeNAS"
/usr/bin/sed -i '' "s/.*hostname =.*/ hostname = ${MYHOSTNAME}/" "${NETDATA_CONF}"
/usr/bin/sed -i '' "s/.*bind to =.*/ # bind to = 127.0.0.1/" "${NETDATA_CONF}"
/usr/bin/fgrep -q "${GUID}" "${STREAM_CONF}" || cat <<EOF >> "${STREAM_CONF}"
[${GUID}]
enabled = yes
default history = 86400
default memory mode = save
health enabled by default = auto
allow from = *
EOF
/usr/sbin/service netdata restart
Then on the headless collectors add this to netdata.conf:
Code:
[global]
memory mode = none
web mode = none
hostname = my fancy hostname for the UI
and this to stream.conf:
Code:
[stream]
enabled = yes
destination = 192.168.178.10:19999
api key = 047cf4d3-5170-11e9-a22c-0cc47afa3c72
Insert a newly created GUID (
uuidgen) for the api key and the correct local IP address for your FreeNAS.Done :)
Kind regards,
Patrick
Last edited: