I imagine a lot of people will be using their Raspberry Pis as low-power servers, perhaps file servers, web servers or just somewhere to ssh to to run an irssi session in tmux! Servers though, need monitoring and statistics. The Raspberry Pi’s resources are a little limiting, so you might not want to run Munin, Collectd on the device itself, but rather monitor it remotely with SNMP. As the leader of the Observium project, what else would I use?
Observium provides a pretty interface to a slew of statistics about your server including CPU, memory and disk usage, load average, network traffic and errors, number of users and processes, system swap i/o, per-disk i/o and disk operations. For the purposes of the Raspberry Pi we won’t use the Agent, which would provide a little more information but might be too heavy for the Pi.
Particularly of interest for the Pi will be how often it uses its swap file and the CPU utilisation.
To monitor a device you need an SNMP daemon to collect statistics and report them back to the central Observium installation, and Linux we use net-snmp.
apt-get install snmpd
We need to download the Observium distro script and move it to /usr/bin
mv distro /usr/bin
chmod 755 /usr/bin
We need to create a configuration file at /etc/snmp/snmpd.conf
com2sec readonly default #COMMUNITY#
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup “” any noauth exact all none none
#This line allows Observium to detect the host OS if the distro script is installed
extend .126.96.36.199.4.1.2021.7890.1 distro /usr/bin/distro
Replace #COMMUNITY# with a secret string and #LOCATION# and #CONTACT# with sensible values for your Pi.
Also change the SNMPDOPTS in /etc/default/snmpd to match this:
SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -g snmp -p /var/run/snmpd.pid’
You’re now ready to add the Raspberry Pi to an Observium installation.
If you’d like to monitor your Raspberry Pi but don’t have anywhere to run the monitoring software, I’ve set up a communal Observium instance at http://raspberrypi.observium.org. If you’d like to add your Raspberry Pi to it, contact me! You’ll need to have either a static IP or a hostname pointed at your dynamic IP. If your Pi is behind NAT you’ll need to forward SNMP (UDP port 161) to it and allow the Observium server (188.8.131.52) to access this port.