Installing Smokeping for Monitoring Network Latency in Critical Infrastructure

Installing Smokeping for Monitoring Network Latency in Critical Infrastructure

Installing Smokeping for Monitoring Network Latency in Critical Infrastructure

This guide is meant to be the first in a series of blog posts that aim to provide a comprehensive understanding of installing Smokeping. 

In this blog post, we will review a step-by-step guide for installing Smokeping on a server or infrastructure. We’ll take a look at what Smokeping is, its benefits, and how to install it so that you can monitor your network latency.

Table of Contents

Why is Smokeping needed?

Network latency is a critical factor that affects the performance of any network-based service or application. It refers to the time it takes for a packet of data to travel from its source to its destination. High latency can lead to a poor user experience, slow application response times, and even lost business. That’s why monitoring network latency and understanding its causes is essential for maintaining a high-performing network. Smokeping is an open-source network latency monitoring tool that can help you keep tabs on your network latency and ensure that it is performing as expected.

What does Smokeping do?

Smokeping is designed to measure the round-trip time (RTT) of packets between two or more hosts on a network. Smokeping is written in Perl and works by sending ICMP (Internet Control Message Protocol) echo requests and recording the time it takes for each request to be completed. It then turns the data into pictures, which make it easy to spot any network latency problems.

Where is Smokeping used?

From small local networks to large enterprise networks, Smokeping can also be used to monitor the latency of individual applications, web servers, databases, and more.  Smokeping offers a number of features that make it easier to identify any issues with network latency. For example, it can be used to monitor the latency of specific applications or services on a network, as well as the latency of remote network services. Another benefit of Smokeping is that it provides detailed visualizations of the data it collects. This makes it easier to identify any latency issues, as well as to determine the cause of the problem. For example, Smokeping can display the latency of each hop in a network, allowing you to quickly identify any bottlenecks.  Finally, Smokeping is an open-source tool, which means that it can be used for free. This makes it an attractive option for small businesses and individuals who don’t have the budget for expensive network monitoring solutions.

Is it difficult to use Smokeping?

Installing and setting up Smokeping is a straightforward process that only takes a few steps. First, you will need to download the Smokeping package. Once it is downloaded, you will need to install it using the installation instructions included in the package. Once it is installed, you can configure it by editing the configuration files.  After Smokeping is installed and configured, you can start to use it to monitor your network latency. To do this, you will need to specify the hosts or services that you want to monitor. You can then set up the tests or “probes” that you want Smokeping to run and configure the data that you want it to collect.  You can establish thresholds, alerts, and automation.

Smokeping Graph

Installing and Configuring Smokeping

This is a step-by-step guide for installing and configuring Smokeping on a server. It will cover the necessary components and dependencies, although in this blog post we won’t be covering setting up Smokeping probes and configuring monitoring targets. It will also discuss some of the common challenges and troubleshooting tips for installing and configuring Smokeping.

Smokeping Sequence Diagram
smokeping sequence diagram

Smokeping requires Perl

In order to install and run Smokeping, there are a few necessary components and dependencies that must be present on the system. The primary dependency for Smokeping is Perl, which is a high-level, general-purpose programming language. Perl is used to run the Smokeping scripts and is required for the software to function properly. Additionally, Smokeping relies on RRDtool, which is a data logging and graphing system. RRDtool is used to store and display the latency and packet loss data that Smokeping collects, and it is necessary for generating the graphs and reports that Smokeping provides.  You can learn about the RRDtool by watching parts one and two video tutorials from its creator Tobias Oetiker.

Perl can be easily installed on most operating systems, including Windows, Linux, and macOS. For Windows, the ActivePerl distribution is recommended, which can be downloaded for free from the ActiveState website. For Linux and macOS, Perl is typically included with the operating system or can be easily installed via the package manager. Once Perl is installed, it is necessary to install any additional Perl modules that Smokeping requires. These modules can be found in the Smokeping documentation and can be installed via the CPAN tool (Comprehensive Perl Archive Network).

Smokeping Requires RRDtool

RRDtool is also a dependency for Smokeping; it is a software that stores and retrieves data and generates graphs. RRDtool is not included with most operating systems, so it may need to be installed separately. The installation process for RRDtool can vary depending on the operating system, but it is typically available as a package in most Linux distributions package managers, or can be downloaded from the RRDtool website. Once RRDtool is installed, it must be configured to work with Smokeping, typically by setting the path to the RRDtool binary in the Smokeping configuration file.

smokeping architecture diagram
smokeping architecture diagram

Smokeping requires a web server

The web server software is another important dependency for Smokeping. Smokeping can be configured to run on ApacheLighttpd, or Nginx web servers. The web server is responsible for serving the Smokeping web interface to users, so it must be installed and configured correctly for Smokeping to function properly. Depending on the web server chosen, additional modules or configurations may be needed. For example, if using Apache, the mod_cgi and mod_alias modules must be installed and enabled, and the Smokeping configuration filemust be properly configured to work with Apache.

Smokeping requires a database

Smokeping also requires a database to store its configuration data. It is compatible with SQLite, MySQL, and MariaDB database servers. The database is used to store the latency and packet loss data that Smokeping collects, and it is necessary for generating the graphs and reports that Smokeping provides. If you choose to use MySQL, you will need to install and configure the database server and create a database and user for Smokeping to use. Additionally, you will need to install the DBD::mysql Perl module, which is required for Smokeping to connect to the MySQL serve.

				
					sudo apt-get install --no-install-recommends gcc make libwww-perl libcgi-fast-perl libtext-soundex-perl libio-pty-perl libcrypt-ssleay-perl \  rrdtool librrds-perl libssl-dev libc6-dev wget autoconf fping -y
				
			

Smokeping Needs Fping

Smokeping relies on the installation of the Fping utility, which is used to perform the actual ping tests to measure network latency. Fping is a command-line utility that sends ICMP echo request packets to network hosts and measures the time it takes for the hosts to respond. Fping is not included with most operating systems, so it may need to be installed separately. The installation process for Fping can vary depending on the operating system, but it is typically available as a package in most Linux distribution package managers, or can be downloaded from the Fping Github.

Other Perl modules for Smokeping

In addition, Smokeping also requires the installation of a few Perl modules such as LWP::UserAgent, CGI, and config::general. These modules can be found in the Smokeping documentation and can be installed via the CPAN (Comprehensive Perl Archive Network) tool. These modules are necessary for Smokeping to function properly, as they provide the necessary functionality for connecting to the web server, handling the CGI interface, and parsing the configuration files.

Alternatives to Perl for Smokeping

It is important to note that there are alternatives to some of the dependencies mentioned above. For example, instead of Perl, you could use a different scripting language such as Python or Ruby. However, Smokeping is primarily developed and supported for Perl, so using a different language may require additional configuration and customization. Additionally, for the web server, you can use alternatives to Apache, Lighttpd, or Nginx, such as IIS or Cherokee. However, as mentioned earlier, you need to configure the web server to work with Smokeping properly.

Database alternatives for Smokeping

For the database, alternatives to SQLite, MySQL, and MariaDB include PostgreSQL and MongoDB. However, these alternatives may require additional configuration and setup to work with Smokeping. For the Fping utility, alternatives such as ping and hping can be used, but it is important to note that Fping is optimized for Smokeping usage.

Smokeping summary

In summary, Smokeping requires various components and dependencies to function properly, such as Perl, RRDtool, web server, database, Fping and additional Perl modules. The installation process for each dependency may vary depending on the operating system, but with the proper installation and configuration of all dependencies, Smokeping can provide an effective way to monitor network latency and packet loss.

Picture of Mike Hamanaka

Mike Hamanaka

Technical Project Manager -- SJULTRA Inc.