Menu
Yum to install the smokeping rpm, or that don't work in Fedora 10 you can always pull that rpm to your system and do an 'yum -localinstall smokeping-2.4.2-7.fc10.noarch.rpm' and yum will take care of all.
Tutorial and steps related to the installation, configuration, and use of theSmokePing software product for monitoring latencywithin network environment.
- Yeah dude, windows rulez da w0rld. 4) “Installation” – Install Activestate Perl – Install RRDtool for windows (unzip, and launch install.cmd) – Unzip smokeping to C: smokeping-2.0.8 – Unzip fping for windows (make sure cygwin1.dll is in the same folder) to C: smokeping-2.0.8 fping – Install WAMP to C: wamp. 5) Modifications.
- I've been trying to find a reference on how to bind smokeping/fping to a particular interface. I see where you can specify the source address but I'm using an RPi as a portable analysis tool to leave at customer sites when they're having issues - so it will usually be a DHCP address i.e.
- SmokePing can be installed on all Linux platforms. Ubuntu $ sudo apt-get install smoking $ sudo /etc/init.d/smokeping restart. Centos # yum install smokping # service smokping restart. Configuring Smokeping. The Smokeping configuration is in the /etc/smokeping/config file.
Background
The ability to monitor your network environments can be handled via a number of various tools andservices, not the least of which are SaaS products provided through external vendors. If you are the“do it yourself” kind of engineer, exploring a tool such asSmokePing is an easy and affordable (free) way toget some very quick latency information exposed to your customers.
This post will explore the installation, configuration, and (basic) usage of the SmokePing product.It is intended to be a primer on the subject, not a full/in-depth tutorial and, as such, some aspectsof the “productization” of the service will not be included.
Underlying Compute Technology/Ecosystem
This tutorial utilizes/makes the following assumptions about your compute infrastructure. Although theinstructions can be extended to accommodate cloud-based and/or other infrastructure environments quiteeasily, all details are explained with respect to local development for the purposes of simplicity:
- Hypervisor Technology: VirtualBox
- Provisioner: Vagrant
- Number of VMs: 2
- Operating System: Ubuntu 16.04
- Arch: 64-bit
- CPUs: 2
- Mem: 4GB
- Disk: 50GB
This tutorial is built with 2 virtual machines serving as the compute resources - one of the resourceswill be the Master/UI instance while the other will be a dedicated poller/Slave instance. The followinghostnames and corresponding IP addresses will be used for the 2 virtual machine instances:
- node1.localhost: 10.11.13.15
- node2.localhost: 10.11.13.16
The following software versions are used as part of this tutorial - again, versions can/may be changed,but there is no guarantee that using different versions will result in a working/functional technologystack. The versions listed are such that they represent a fully-functional and working technologyecosystem:
- RRDTool: 1.6.0 (dependency)
- Apache2: 2.4.18-2 (Master - UI web server)
- SmokePing: 2.6.11 (internal version 2.006011)
Finally, the code blocks included in this tutorial will list, as a comment, the node(s) that the commandsfollowing need to be run on. For instance, if required on both nodes, the code will include a comment likeso:
If the code block only applies to one of the nodes, it will list the specific node it applies to like so:
All commands assume that your user is
vagrant
and the user’s corresponding home directory is /home/vagrant
for the purposes of running sudo commands.End State Architecture
At the end of this tutorial, the following end-state architecture will be realized:
Prerequisites/Dependencies
SmokePing requires several components to be installed prior to installing the software on yourhost system. Most Ubuntu-based distributions come with Perl pre-installed - if this is not thecase, install Perl for your system using the native package manager. In addition, a C-compileris required in order to install the versions of software specific to this tutorial. Note thatwe will install some prerequisites for both nodes up front in preparation for the Slave nodeconfiguration towards the end of the tutorial, while other packages are strictly installed onthe Master due to the capabilities desired (i.e. sendmail for Email handling):
Once Perl is installed, you will need RRDTool - to install the version used in this tutorial,perform the following steps. Note that the actual build and installation of the rrdtool softwareis only done on
node1.localhost
where the actual graphs are generated:Following the installation, running the following command should result in the output of therrdtool version installed:
This SmokePing installation is going to use the Apache web server with CGI support to display its webpages - install the Apache software/supporting module and create the SmokePing directory for servingthe application via Apache:
Finally, we need to configure some defaults related to resolving the hostnames between the node1.localhostand node2.localhost nodes. Update the
/etc/hosts
file on each node to provide name resolution:Installation
Once the installation prerequisites are in place, you can download and install the SmokePing product.First, download, extract, and compile the SmokePing package for the version you wish to install tothe Master and Slave nodes:
To ensure that the appropriate Perl modules are in place, run the setup script to install any thatmay be missing, along with the
apt-get install
command for the librrds-perl package. Although theRRD files and corresponding graphs are only generated on the Master instance, the build of theSmokePing software will ultimately fail if the librrds-perl
package is not installed, so we willinstall this on both instances:Once the package has been extracted and dependencies for the Perl environment are in place, proceedto building and installing the software:
If the above commands were successful, you should be able to run the following and receive outputcorresponding to the version of SmokePing installed:
Configuration
Now that the SmokePing application code is in place, we can continue to configure the applicationfor use. In this particular installation, the configuration file was created with a trailing
.dist
name. This will cause some issues with the way the scripts are expecting the configuration file toexist and, as such, we will create a symlink to the configuration file without the .dist
trailingname to ensure everything works as expected:Edit the /opt/smokeping/etc/config file for your environment. There are a lot of configuration optionsavailable and the format is quite complicated - we will focus on a few paramaters to start with:
In addition to the above configuration changes, re-open/edit the configuration file to replacethe section
++ James
with the Master/localhost configuration information so that data can bevisualized for the Master instance:Before starting the application, several directories must exist in order for the out of boxconfiguration to function as expected, and certain permissions must be in place for the outof box security to work:
The Apache server needs to be configured to serve the web interface for the SmokePing application -to configure this, copy the files from the SmokePing
htdocs
folder into the respective Apache webfolder, and edit the Apache default virtual host file:Once the configuration file is in place, enable the FastCGI and SUExec modules and restart theApache web server:
Now that the web server is up and running, visit the web page located at http://10.11.13.15/ andyou should see the SmokePing web interface presented to you. There is likely no data due to not yethaving run any pollers to collect information.
We need to start the SmokePing daemon in order to start generating some data and graphs. Start bylaunching the application in the foreground (“debug” mode) and inspecting for errors:
After some time, the output will generate some results that ultimately result in some graphs beinggenerated. Navigate back to your browser and reload the webpage - in the left menu navigation,select the “Targets -> node1.localhost” options to view the generated graphs. If no data appears butno errors are seen in the command-line debug session, leave the agent running in the foreground fora few minutes until the page appears with data.
If all is successful, you can terminate the foreground agent job and launch the smokeping agent indaemon mode to have it run continuously in the background on your Master node like so:
Refresh your web page and you should see updates to the graphs for the Master node (node1.localhost).The graph will appear towards the top of the page. You can also select the “Test -> node2.localhost”node to view the graph data for the Slave node as well (being pinged from the Master).
Slave Poller
Now let’s add a secondary poller on the Slave “node2.localhost”. This poller will check both theMaster and the Slave and will demonstrate distributing pollers on separate machines that reportback to the Master instance. Note that in order for the following configurations/setup to work, theresult of the command
hostname
on the node2.localhost
node should report node2
.First, we need to configure the Master instance to accept the Slave communication as well as tell theSlave which nodes to poll - update the configuration sections as follows on the Master:
Before reloading the configuration, we need to update the secret for the Slave to be able tocommunicate with the Master, and ensure the Apache process can read it:
Next, reload the configuration on the Master node for the new Slave information to take effect,and ensure that the Apache process is also restarted for this to work:
Once you’ve updated the configuration on the Master node, we need to set up the Slave instance.Note that if you try to view the web interface at this point you will likely see various errorscorresponding to missing ‘slave1’ data/graphs - this is because the Slave has not yet beenconfigured and communicated with the Master for the first time.
If you ran the commands to install the SmokePing on the Slave instance in parallel as the instructionsat the beginning of this tutorial stated, you can simply proceed with the next steps (if you didnot follow the instructions and do not yet have the SmokePing application installed, go back andrepeat the relative steps for the Slave instance above).
First, there are a few Perl dependencies we need to install by hand since we did not install Apacheand/or the relative dependencies associated with the Master instance:
Once complete, create a secret file on the Slave so that when the process starts it knows how tocommunicate with the Master instance, and secure the file:
Now you are ready to launch the poller:
If you received output as indicated, your Poller/Slave instance has successfully establishedconnectivity and is communicating with the Master. If you received some other kind of output,inspect the log output to see what may have gone wrong.
Navigate back to the SmokePing web interface and refresh/reload the web page. You should now seestacked graphs showing poller results for the Master node poller along with a secondary graphindicating the results from the node2.localhost (Slave) poller. If there is no data within thesecondary graph, give the poller a few minutes to finish its first round of polling and sendingthe results to the Master for rendering.
There are many more additional capabilities that are possible with this tool - this primer isstricly a starting point. Visit the project page for more information about the tool and itsoperation.
Disclaimers
As stated in prior tutorials, this tutorial is in no way intended to be a ‘production-ready’setup. There are various tuning and configuration parameters, security settings, and overallarchitecture/directory structure changes that would need to be made in order to make thistutorial match a production-ready setup of the SmokePing application. It is intended to be aprimer of installing and configuring the application for basic use and, as such, the knowledgecontained within can be leveraged to further develop a more production-ready solution.
Credit
The above tutorial was pieced together with some information from the following sites/resources:
Learning has never been so easy!
This is a walkthrough on how to build a cheap and effecient latency monitor . It is built on a Raspberry Pi computer that is cheap (less than $70 for the mainboard, case, power supply, and storage device.) This setup will use less power than a normal computer (I measured my Raspberry Pi model B+ running at 3 watts!) That last thing I really like about this method of monitoring is that the Raspberry Pi is a completely solid state device, and as such it should last for many years beyond what a normal computer or server can function.
**Note: This guide assumes that you have a DHCP on your network and a functional internet connection.
13 Steps total
Step 1: Setup your SD card and install Raspian
http://community.spiceworks.com/how_to/show/93661-initial-setup-of-a-raspberrypi
Step 2: Change passwords as appropriate
Step 3: Login as pi
default password is: 'raspberry'
Step 4: Update all installed packages:
- Type: 'sudo apt-get update' and press ENTER
- Type: 'sudo apt-get upgrade' and press ENTER
- Type: 'sudo apt-get upgrade' and press ENTER
Step 5: Install smokeping and sendmail:
- Type: 'sudo apt-get install smokeping sendmail' and press ENTER
Step 6: Enable a2enmod in apache
- Type: 'sudo a2enmod cgi' and press Enter
Step 7: Create list of targets to monitor with smokeping:
- Type: 'sudo nano /etc/smokeping/config.d/Targets' and press ENTER
---a. On line 6 you can change “Network Latency Grapher” to anything you would like displayed at the top of the main webpage.
---b. On line 7 you can change the remark to anything you would like to display below the title of the main page.
---c. At the bottom of the text file you can add nested links to various addresses you would like to monitor. You can nest links by how many “+” signs you have in front of the link header.
---d. At the bottom of the file add some hosts to monitor. (omit the quotes):
---b. On line 7 you can change the remark to anything you would like to display below the title of the main page.
---c. At the bottom of the text file you can add nested links to various addresses you would like to monitor. You can nest links by how many “+” signs you have in front of the link header.
---d. At the bottom of the file add some hosts to monitor. (omit the quotes):
“
+ myservers
+ myservers
menu = My Servers
title = My servers for my company
title = My servers for my company
Smokeping Install
++ Server1
menu = Server1
title = Server1 (IP-192.168.0.2)
host = 192.168.0.2
alerts = hostdown
title = Server1 (IP-192.168.0.2)
host = 192.168.0.2
alerts = hostdown
++ Server2
menu = Server2
title = Server2 (note about server)
host = 192.168.0.3
title = Server2 (note about server)
host = 192.168.0.3
+ Routers
menu = Routers
title = Routers for my company
title = Routers for my company
++ Router1
menu = Router
title = Main Router
host = 192.168.0.1
alerts = hostdown
title = Main Router
host = 192.168.0.1
alerts = hostdown
+ Internet
menu = Internet
title = Internet Latency to Google DNS
host = 8.8.8.8
“
title = Internet Latency to Google DNS
host = 8.8.8.8
“
* Save the changes you made to the file:
* Press CTRL + X
* Press Y
* Press ENTER
* Press CTRL + X
* Press Y
* Press ENTER
Step 8: Setup alerts to email you when a host goes offline
Smokeping Config
- Type: 'sudo nano /etc/smokeping/config.d/Alerts' and press ENTER
- Change the 'to = [email protected]' to your email address or distribution group.
- Add the following at the bottom of the text (but omit the quotes):
'
#This Alert checks for one period (1 * 5mins) of more than 60% loss
+hostdown
type = loss
pattern = >60%
edgetrigger = yes
comment = Host is OFFLINE
'
#This Alert checks for one period (1 * 5mins) of more than 60% loss
+hostdown
type = loss
pattern = >60%
edgetrigger = yes
comment = Host is OFFLINE
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
# This rule checks for one period (2 * 5mins) of >60% loss
+hostdown2
type = loss
# in percent
pattern = >60%,>60%
edgetrigger = yes
comment = Host is OFFLINE
+hostdown2
type = loss
# in percent
pattern = >60%,>60%
edgetrigger = yes
comment = Host is OFFLINE
# This is an alert for Lorraine
+Lorraine_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Lorraine - You turned your computer off so it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
+Lorraine_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Lorraine - You turned your computer off so it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
# This alert is for Bob
+BobB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Bob - You turned your computer off so it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
+BobB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Bob - You turned your computer off so it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
# This alert is for Dan
+DanB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Dan - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
+DanB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Dan - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
# This is an alert for JoAnn
+JoAnnH_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = JoAnn - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
+JoAnnH_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = JoAnn - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
# This alert is for Mark
+MarkB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Mark - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
'
+MarkB_Alert
type = loss
pattern = >60%,>60%,>60%
edgetrigger = yes
comment = Mark - You turned your computer off and now it wont be backed up. PLEASE REMEMBER TO LEAVE YOUR COMPUTER ON OVERNIGHT.
to = [email protected]
'
* Save the changes you made to the file:
* Press CTRL + X
* Press Y
* Press ENTER
* Press CTRL + X
* Press Y
* Press ENTER
Step 9: Configure access to your SMTP (email) server
- Type: 'sudo nano /etc/smokeping/config.d/General' and press ENTER
- On Line 3 change 'Peter Random' to your name.
- On line 4 change '[email protected]' to your email address.
- On line 5 change 'my.mail.host' to the DNS name or IP address of your SMTP server.
- On line 4 change '[email protected]' to your email address.
- On line 5 change 'my.mail.host' to the DNS name or IP address of your SMTP server.
![Smokeping Smokeping](/uploads/1/1/9/8/119845976/351996680.png)
* Save the changes you made to the file:
* Press CTRL + X
* Press Y
* Press ENTER
* Press CTRL + X
* Press Y
* Press ENTER
Step 10: Reboot the RaspberryPi:
Type “sudo reboot” and press ENTER
Step 11: Check the webpage of your new latency monitor!
http://hostname/cgi-bin/smokeping.cgi (example: http://smokeping/cgi-bin/smokeping.cgi if your rPi's hostname is 'smokeping')
Note: if you see errors on the webpage then you may need to reboot the RaspberryPi and wait for 15-20 minutes for data to be generated.
Step 12: .
Step 13: Spice up this article so other admins can find it too!
Published: Oct 17, 2014 · Last Updated: Jan 18, 2018
Smokeping For Windows 10
11 Comments
Install Smokeping On Windows 10 Pro
- ChipotlexTROUBLEx Oct 21, 2014 at 12:34amvery interresting thanks for the share will use this on my raspberry that is laying around somewhere
- Sonorarobbie strong Jan 13, 2015 at 06:14pmI set this up, and it works very well. Thank you very much for your post!
- Pimientotimpulver Jun 16, 2016 at 07:56pmAfter following instructions, I type the link into a browser and get nothing.. Can this only be accessed via the local network?
- CayenneJakeBar Jun 16, 2016 at 08:04pm@timpulver - yes, this is only for LAN access. If you want to access it online then you will have to know your public IP address and forward port 80 to the internal ip of the smokeping server.
- Pimientotimpulver Jun 16, 2016 at 08:10pmThanks for the Fast reply, unfortunately I still am not able to access it locally either.Is there a step needed to enable the web server portion of the PI? This is a newly installed version of Raspain Jessie
- CayenneJakeBar Jun 16, 2016 at 08:20pmtry putting the Pi's ip address in place of the hostname - http://192.168.0.51/cgi-bin/smokeping.cgialso, i seem to remember that you have to wait for one period (default = 5 min) before everything starts running well.
- PimientoStephan2225 Apr 25, 2017 at 03:22pmi follow your instractions step by step. But my Raspberry shows always an error:
The requested URL /cgi-bin/smokeping.cgi was not found on this serverWhat to do?Greetings
ruebenmaster - PimientoStephan2225 Apr 25, 2017 at 05:00pmok, i found out:a2enmod cgiis the solution....Greetings
ruebenmaster - Pimientotimbrady2 Apr 25, 2017 at 10:08pmI followed all of your instructions excluding steps 7 and 8. I can't seem to access the page. I keep getting the error - The requested URL [raspberr]/cgi-bin/smokeping.cgi was not found on this server. I also tried [raspberry IP]/cgi-bin/smokeping.cgi as well. Any ideas? Thanks for your help.
- Pimientospicehead-fvbi3 Sep 4, 2019 at 06:33pmMy apologies if this isn't the right place for this. I've been trying to find a reference on how to bind smokeping/fping to a particular interface. I see where you can specify the source address but I'm using an RPi as a portable analysis tool to leave at customer sites when they're having issues - so it will usually be a DHCP address i.e. I won't know the source IP ahead of time. Do you know of a way to do this or could you point me in the right direction. Thank you.
- Pimientospicehead-d2hhk Aug 19, 2020 at 12:31pmI'm wondering if `sendmail` is no longer a requirement in 2020
I see no reference to it in the spokeping docs
https://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html