Open Source

Monitor connectivity with SmokePing, part 1


If you are supporting multiple networks on geographically dispersed sites, then it's pretty much essential to have some type of quick reference in place to display the basic status of network connectivity between each one. This becomes even more important when those sites are distributed globally -- as the potential for disruption due to unforeseen circumstances is greatly increased.

At the beginning of this year, I ran into problems when an earthquake in Taiwan disturbed undersea transport cables. This bizarrely threw our Korean office into a total Internet blackout (and Korea is quite a way from Taiwan), which later proved to be due to packet loss caused by the rerouting of traffic in an attempt to work around the broken channels. Hong Kong experienced intermittent losses of connectivity for the same reasons. This is obviously something that can't be avoided, but with a simple and straightforward platform to display statistics on your interoffice connectivity, it's much easier to get a high-level view of network status.

In situations in which network response becomes erratic, being able to view a historical chart of TTL and packet loss statistics can be a great aid in understanding how changes in routing paths outside of your networks have affected your WAN links and, therefore, the services that run across them.

SmokePing is a simple Web-based package that produces easy to read graphical representations of network latency and link quality. By recording TTL and packet loss statistics for multiple network links, it allows administrators to go back and see when an issue started to show itself, whether or not it's specific to one site or region and it also helps to show any patterns which may be developing. Diagnosis is the first step towards cure!

Prerequisites for Smoke Ping

In order to install Smokeping, there are a few prerequisites that must be met. The following must be installed:

Apache (1 or 2)

Perl

RRDtool

SpeedyCGI

FPing

If you're using Debian, Ubuntu, or Red Hat then you can install these via apt-get or yum. If you prefer, you can compile and install each of them manually, which is what I'm going to do here. I'll skip the Apache install as I already have Apache (2) installed and running on this particular server.

Install RRDtool

http://oss.oetiker.ch/rrdtool/

Download the latest stable release of RRDtool. Unpack it to your build directory and take a look at doc/rrdbuild.txt for full installation instructions; I decided to install in /usr. During the configuration step, I found that I needed to install two libraries with apt-get in order for RRDtool to compile:

# apt-get install cgilib libart-2.0-dev
# mkdir /usr/share/rrdtool
# ./configure --prefix=/usr

After a successful configuration (no errors), build and install with:

# make && make install

Check for a successful installation:

# which rrdtool
/usr/bin/rrdtool

Install the SpeedyCGI module

http://daemoninc.com/SpeedyCGI

Moving on, we now need to install SpeedyCGI and afterwards configure Apache to load it. This is actually pretty simple if all of the installation scripts work properly. I'm using Apache 2 and I needed to install the apache2-threaded-dev package with apt-get before continuing:

# apt-get install apache2-threaded-dev

Unpack the SpeedyCGI archive in your build directory and then change to that directory. Now start the configuration with:

# perl Makefile.PL

You will be asked whether or not to build the Apache mod_speedycgi module; I said no, as I have had problems with this and Apache 2.

Once that's done, continue with the compiling and installation:

# make
# make test
# make install

Now to build the mod_speedycgi module, navigate to the mod_speedycgi2 directory. Before kicking off the script, create a sym-link called apxs:

# ln -s /usr/bin/apxs2 /usr/bin/apxs

I found this was necessary due to running Apache 2; if using Apache 1, the file is called apxs anyway. Now execute the Makefile:

# perl Makefile.PL

That should finish without any errors; continue by compiling and installing the module.

# make && make install

I didn't have any trouble building this on my system. I checked the /etc/apache2/httpd.conf:

LoadModule speedycgi_module modules/mod_speedycgi.so

And found that it had correctly inserted. The module mod_speedycgi.so had also been copied to the correct location. If you come across any errors at this point, I would suggest searching through the SpeedyCGI mailing list as it's more than likely others have seen the same error before.

To complete the installation, restart Apache and check the logs for any errors related to the mod_speedycgi module.

Install FPing

The last tool to install is FPing. FPing is very similar to the standard ping command, but it extends the feature set making it much easier to ping multiple hosts from one command. Unfortunately the FPing Web site and SourceForge project seem to be very poorly maintained. I would recommend installing via apt-get if you can otherwise get the source from the Debian packages repository (right hand bar). No configuration should be required so it will be simple:

# ./configure && make && make install

Test the installation with:

# which fping
/usr/bin/fping

Now we have all of the underlying components installed and configured. Later in the week, I'll tackle the installation and configuration of SmokePing itself.

4 comments
Kumaran
Kumaran

Use cacti and add smoke ping plugin. And cacti is more broad view badnwidth monitor. It has a Windows Binary but have never used it. http://cacti.net/

jpb
jpb

This is the biggest downfall of open source, every programmer has his or her own "favourite" packages they like to use, like SpeedyCGI and FPing. When packages like this fall by the wayside, then you are stuck. I'd love to implement something like this, but the dependency list contains packages I can't put on a trusted server.

wolvie3421
wolvie3421

any good similar products for the windows side?