SmokePing is a useful tool developed by Tobias Oetiker and Niko Tyni which monitors and visualize one’s network latency. The (for me) most important core features are the following:
- A wide range of measurement plugins
- Master/Slave setup is possible
- Good-looking rrd based graphs
- Open Source/GPL 2 (or higher) licensed
In my opinion, it does a really good job on longterm monitoring when there’s need of drawing graphs over a long time period. Don’t get me wrong, SmokePing is capable for shortterm monitoring as well, e.g. exploring graphs for the last couple of hours to find network outages and its integrated alerting system does a good job, but I’d suggest using more advanced network monitoring solutions like Nagios for those purposes.
In Ubuntu (Intrepid) or Debian (Lenny) the package looks like this:
user@server:~$ aptitude show smokeping Package: smokeping State: installed Automatically installed: no Version: 2.3.6-1 Priority: extra Section: universe/net Maintainer: Ubuntu MOTU Developers Uncompressed Size: 2732k Depends: perl (>= 5.6.0-16), libnet-perl, libwww-perl, libsnmp-session-perl (>= 0.86), librrds-perl (>= 1.2), liburi-perl, fping (>= 2.4b2-to-ipv6-2), speedy-cgi-perl (>= 2.21-1), exim4 | mail-transport-agent, debianutils (>= 1.7), adduser, lsb-base (>= 3.0-6), libdigest-hmac-perl, ucf (>= 0.28) Recommends: apache2 | httpd, libsocket6-perl, dnsutils, echoping Suggests: curl, libauthen-radius-perl, libnet-ldap-perl, libnet-dns-perl, openssh-client, libio-socket-ssl-perl, libnet-telnet-perl [...]
It’s easily installed with all its dependencies by the following command:
sudo aptitude install smokeping
The html files will be installed to /var/www/smokeping, cgi to /usr/lib/cgi-bin and SmokePing’s configuration to /etc/smokeping. If you didn’t alter the apache configuration yet, the default vhost works just perfectly. You should be able to access the web-interface right away by typing http://localhost/smokeping/ in your favorite browser. If not, you’ve probably altered your webserver’s configuration and should know how to setup a cgi-capable environment for SmokePing on your own.
Let’s take a deeper look on the configuration in /etc/smokeping:
- basepage.html – contains the structure and layout for the web-interface
- config – includes all files in /etc/smokeping/config.d
- config.d – directory for the distributed configuration
- Alerts – configuration for the alerting system
- Database – defines rrd parameters
- General – defines general information like owner, contact, mailhost, etc.
- pathnames – various pathnames that needs to be configured
- Presentation – options to define the presentation of SmokePing
- Probes – configuration of measurement plugins
- Slaves – part of the Master/Slave setup
- Targets – configuration of targets that needs to be monitored
- smokemail – part of configuration for dynamic IP support
- tmail – tSmoke html mail template file
Now don’t get frustrated. You don’t need to alter every single config file to get SmokePing running. As you may experience, most of the default values are working like a charm.
Let’s begin with configuring general information in /etc/smokeping/config.d/General. Feel free to configure the mailhost, but for an initial configuration there’s no need for it.
user@server:/etc/smokeping$ sudo cat config.d/General *** General *** @include /etc/smokeping/config.d/pathnames # Please edit this to suit your installation owner = Mike Adolphs contact = mike@matejunkie.com cgiurl = http://localhost/cgi-bin/smokeping.cgi mailhost = smtp.mailhost.abc # specify this to get syslog logging syslogfacility = local0 # each probe is now run in its own process # disable this to revert to the old behaviour # concurrentprobes = no
The next file you probably want to configure is /etc/smokeping/config.d/Probes. There you’ll be able to define other measurement plugins besides ICMP. In the following example I’ve defined DNS and HTTP measurement methods. Each of the measurement plugins comes with various configuration parameters like pings, step, urlformat or else. Each plugin make use of the binary parameter. For a complete list of parameters you should consider the official documentation.
user@server:/etc/smokeping$ sudo cat config.d/Probes *** Probes *** + FPing binary = /usr/sbin/fping + DNS binary = /usr/bin/dig pings = 5 step = 180 + Curl binary = /usr/bin/curl pings = 5 step = 60 urlformat = http://%host%/
The third and final configuration file for our initial configuration is /etc/smokeping/config.d/Targets where you’re able to define the targets that needs to be monitored. The layout of the configuration file is straight-forward. Therefore I won’t explain the various parameters in detail.
user@server:/etc/smokeping$ cat config.d/Targets *** Targets *** probe = FPing ## You have to edit and uncomment all what you want below this. # Please, refer to smokeping_config man page for more info # The given adresses aren't real to avoid DoS. menu = Top title = Network Latency Grapher remark = Welcome to the SmokePing website of Mike Adolphs. + slashdot menu = slashdot title = slashdot ++ ICMP probe = FPing menu = ICMP title = ICMP host = www.slashdot.org ++ HTTP probe = Curl menu = HTTP title = HTTP host = www.slashdot.org ++ DNS probe = DNS menu = DNS title = DNS lookup = www.slashdot.org server = 141.1.1.1 host = www.slashdot.org
As Ubuntu uses speedy-cgi with SmokePing’s cgi script its interpretation becomes persistent (and much faster in its execution in large environments). Therefore you have to touch /etc/smokeping/config when you’ve altered the configuration! Otherwise the changed configuration parts in /etc/smokeping/config.d won’t be recognized.
user@server:~$ sudo touch /etc/smokeping/config
You’re also free to change the interpreter from /usr/bin/speedy to /usr/bin/perl in the smokeping.cgi to disable the persistent behaviour:
user@server:/usr/lib/cgi-bin$ head -n2 smokeping.cgi #!/usr/bin/speedy # -*-perl-*-
… to …
user@server:/usr/lib/cgi-bin$ head -n2 smokeping.cgi #!/usr/bin/perl # -*-speedy-*-
One more note on reloading the daemon: In most cases it’s simply not necessary. SmokePing recognizes changes in the /etc/smokeping/config.d directory during runtime when you’re using /usr/bin/perl as the interpreter instead of the persistant method with speedy. But as I already said, for me SmokePing is a method to provide longterm monitoring without major changes to the targets. Therefore I don’t make use of these features and stick to the speedy way. Touching the file is not much of a problem, reloading the daemon a safe way to see whether there are syntax errors in the configuration or not.
If you want more information (you probably will), stick to the official documentation or sign up and dig through the archives of the mailing list.
Thanks for this.