System Monitoring (with Netdata)

Netdata allows us to monitor the historical and real-time resources used by the PiServer with a visual dashboard in the browser.


  1. By default the web interface accepts all connections, we configure it to listen to localhost. (While the web interface is read-only, it reveals sensitive information.)


The /etc/netdata/edit-config command is incorrect. Modify it with sudoedit edit-config

Line 12: [...] NETDATA_USER_CONFIG_DIR="/etc/netdata"

Line 13: [...] NETDATA_STOCK_CONFIG_DIR="/usr/lib/netdata/conf.d"

We will use netdata.

sudo pacmatic -S --needed netdata
sudo systemctl enable --now netdata

We will create the main configuration file at /etc/netdata/netdata.conf

    # A data point every 10 seconds for 24 hours
    history = 8640
    update every = 10
    error log = syslog
    access log = none

    bind to = localhost

    script to execute on alarm = /etc/netdata/

We will also modify the charts configuration file sudo -u netdata /etc/netdata/edit-config charts.d.conf; uncomment the following line at the end:


To save memory we will enable Kernel Same-page Merging (KSM), i.e. RAM deduplication. We run it every 5 seconds (the default is every 20 ms) because netdata collects every 10 seconds.

  • [ ] TODO: Run the following on boot,
echo 1 | sudo tee /sys/kernel/mm/ksm/run
echo 10000 | sudo tee /sys/kernel/mm/ksm/sleep_millisecs

We will enable email alerting with:

sudo gpasswd -a netdata mail
sudo cp /usr/lib/netdata/plugins.d/ /etc/netdata/

To enable email alerting (assuming you have set up msmtp), we must modify because it is using directories it shouldn't be.

Line 162-164:

  • /etc/netdata
  • /usr/lib/netdata/conf.d
  • /var/cache/netdata

Note that [health] and copying would also be unneccessary if this was fixed.

Test with: sudo -u netdata ./ test


    /etc/systemd/system/ \
    /etc/netdata/netdata.conf \
    /etc/netdata/charts.d.conf \
    /etc/netdata/health_alarm_notify.conf \
    /etc/netdata/ \


  1. gpasswd -a netdata mail

Monitoring netdata:

  • Logs can be viewed with ssudo journalctl -u netdata
  • Memory usage and KSM can be viewed with netdata itself, of course!


  • It runs with process scheduling policy = idle by default - this is lower than nice=19.


results matching ""

    No results matching ""