In my previous post, I detailed how to install and configure Cacti on a Raspberry Pi. In this post, I’ll show you how to do the same with SmokePing, a latency graphing tool. The combination of the two make for a very useful monitoring and troubleshooting tool for SOHO/SMB networks. This process will work on both a Raspberry Pi Model B+ and a Raspberry Pi 2 Model B. If you’re planning to install both tools onto the same RPi, make sure to go through the Cacti install first. For some reason, Cacti cannot configure itself correctly when SmokePing is already installed, but SmokePing will install and run properly after Cacti has been installed. Also make sure you’re using a large SD card. I used 16 GB.
So SSH into your RPi and let’s get started. Remember to use sudo if you aren’t root.
apt-get update/upgrade (if you’re continuing on from the Cacti post, you can skip this step)
to make sure your package index is up to date.
apt-get install smokeping sendmail
to install smokeping and sendmail. After installing SmokePing by itself and having it not work, I did some searching and found that there is a bug which causes SmokePing to not work unless sendmail is present. This is annoying, as sendmail increases the install time on a Raspberry Pi significantly. So, grab more coffee and wait for it to complete.
If you try without sendmail, you’ll see the error below in your browser when you try to access the web interface.
Before we configure any graphs, we need to link the smokeping apache config, and then enable it and another file called mod_cgi. I believe this has to do with changes made to one package without the other being updated for it. Do this with the following commands.
ln -s ../../smokeping/apache2.conf smokeping.conf
service apache2 restart
With that complete, you can open your browser and point it at hostname/cgi-bin/smokeping.cgi. With no config, you’ll see the page below.
So, lets head back to our SSH session and edit some of the config. All the files you’ll want to change are located in /etc/smokeping/config.d/.
The files you should configure are:
- General – the owner name, contact info, etc.
- Probes – configure the probes you want to use. I have only used fping. As an example, the probe below will send 10 pings every 60 seconds. The default config does not have those two lines. If you’re ok with 20 pings every 5 minutes (the default) then don’t add anything here.
- Targets – configure the hosts you want to monitor, such as workstations, servers, switches, routers, access points, or specific points on the internet.
- Presentation – configure the size and appearance of the graphs. I only change the width and height for the overview and detail sections to 1000 wide by 200 high. As with Cacti, you can set this to fit on your monitor as you please.
You can now point your browser at hostname/cgi-bin/smokeping.cgi. You may end up with the error seen here if you changed the Probes file.
This is a result of changing the probe FPing, which was being used to gather data for the LocalMachine entry in the Targets file. It’s very simple to fix: remove the file mentioned in the error with the command
This happens because the LocalMachine target is set up before you change the Probe value. As long as you set up all your other targets after you set your probe settings, you won’t have to remove any other .rrd files. If you remove the file, you must do service smokeping restart to recreate the .rrd file with the correct settings. Then refresh your browser, and voila!
The graphs take some time to populate as they gather data, but eventually you’ll see something like this.
Thanks for reading, and please comment!