Monitoring the Raspberry Pi with Observium
by adama on Jul.18, 2012, under Linux, Observium, Raspberry Pi, SNMP
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
wget http://www.observium.org/svn/observer/trunk/scripts/distro
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
syslocation #LOCATION#
syscontact #CONTACT##This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.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’
Restart snmpd:
/etc/init.d/snmpd restart
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 (46.105.127.13) to access this port.

July 18th, 2012 on 14:56
Hi Adama,
I see a small mistake in your suggested snmpd.conf:
You state: “com2sec readonly #COMMUNITY# default”
But it should be the other way around “com2sec readonly default #COMMUNITY#”
July 19th, 2012 on 02:49
Thanks Job! WordPress helpfully removed the originals i used because of the <>, i must have replaced the community in the wrong place!
October 18th, 2012 on 07:00
The topically applied medication is waterproof and easy to apply.
In umteen cases, things in the close surround can lever an
asthma criticise, especially junk and smoke. With organic pest control , everyone comes out a winner.
October 18th, 2012 on 16:04
Thanks a lot! Small correction needed tho’:
chmod 755 /usr/bin
should be
chmod 755 /usr/bin/distro
October 25th, 2012 on 10:25
I followed this guide but when I run
/etc/init.d/snmpd restart
this is the output
/etc/init.d/snmpd: 12: /etc/default/snmpd: -Lf: not found
I also don’t need to create /etc/snmp/snmpd.conf beacuse is already present, I added at the end the lines suggested.
What happen?
October 25th, 2012 on 10:28
Another thing: how can I contact you to add my raspberry to your Observium instance?
November 4th, 2012 on 02:20
Hey great product. I have it up and running except one thing. The CPU graphs are not displaying but everything else appears to be fine and looks great. Anything I can dig into to determine what might be causing this. Thanks and again great web app.
November 4th, 2012 on 09:26
Just wanted to let you know. All is working now.
current setup:
CentOS 6.3
Observium 3403
Apache 2.2.15 (Centos0
php 5.3.3
MySql 5.1.61
RRD Tool 1.3.8
December 28th, 2012 on 09:53
Hi,
Thanks for your tuto, a small mistake through:
“chmod 755 /usr/bin” is missing “distro”
March 30th, 2013 on 22:25
Any ideas why this works fine on the latest debian 7 but im missing the entire processors/cpu section?
April 20th, 2013 on 19:58
Looks like the demo account doesn’t work….did someone change the password?
April 21st, 2013 on 21:28
use http://demo.observium.org
May 14th, 2013 on 07:09
Hi,
How can I contact you to add my Raspberry Pi?
Kind regards,
Matthijs
June 12th, 2013 on 21:36
Hey,
trying to install SNMPD on my latest Raspbian image and it appears that like mcgyver83 explained above. It appears to fail to find that directory and it even appears that the install fails too. With errors, I even tried aptitude remove snmpd && aptitude install snmpd
Errors were encountered while processing:
snmpd
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
So now I am totally loss, my Linux powers of awesomeness are quite weak.
help pls,
June 18th, 2013 on 17:02
I reloaded Raspbian from my image backup.
I followed the steps again and I did not see an error after installing snmp, yet still when I go to
/etc/init.d/snmpd restart
/etc/init.d/snmpd: 11: /etc/default/snmpd: -Lf: not found
What am I doing wrong?
June 14th, 2013 on 09:03
Hey,
Great Post.
Could you help in creating a dummy account so that i can add my raspberry pi.
Thanks