Dear visitor, in case we do not cover a topic you are looking for, then feel free to ask in our freshly created forum for IT-professionals for a solution. We hope our visitors can help you out with your questions. Have a good one. ~ Tom.

How to install SmokePing on CentOS 7

This tutorial explains how to install Tobias Oetiker’s Smokeping into /opt/smokeping on a CentOS 7 box.

Features of Smokeping:
– Best of breed latency visualisation.
– Interactive graph explorer.
– Wide range of latency measurement plugins.
– Master/Slave System for distributed measurement.
– Highly configurable alerting system.
– Live Latency Charts with the most ‘interesting’ graphs.
– Free and open-source Software written in Perl written by Tobi Oetiker, the creator of MRTG and RRDtool

Install Development Tools

Load the development tools needed to compile smokeping.

# yum groupinstall "Development tools"

Following applications are available with the CentOS Development tools yum group:

bison
byacc
cscope
ctags
cvs
diffstat
doxygen
flex
gcc
gcc-c++
gcc-gfortran
gettext
git
indent
intltool
libtool
patch
patchutils
rcs
redhat-rpm-config
rpm-build
subversion
swig
systemtap

There are also dependencies that will install with these tools.

Enable Epel repo

You can install EPEL by running yum install epel-release. The package is included in the CentOS extras repository, enabled by default.

# yum install epel-release

Install packages

Then install the following packages

perl
httpd
httpd-devel
rrdtool-perl
mod_fcgid
rrdtool
perl-CGI-SpeedyCGI
fping
perl-Sys-Syslog

# yum install perl httpd httpd-devel mod_fcgid rrdtool perl-CGI-SpeedyCGI fping rrdtool-perl perl-Sys-Syslog
Add a few of the pre packaged CPAN modules

# yum install perl-CPAN perl-local-lib perl-Time-HiRes

Install smokeping

Now download the latest smokeping package available at http://oss.oetiker.ch/smokeping/pub/
The current version at the time of the writing is 2.6.11

# cd /root
# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz

then extract it

# tar xfz smokeping-2.6.11.tar.gz
Install perl modules needed by smokeping

# mkdir /opt/smokeping
# cd smokeping-2.6.11/setup
# ./build-perl-modules.sh
# cd ..
# cp -r thirdparty /opt/smokeping/
# ./configure --prefix=/opt/smokeping
# make install

Configure smokeping

Then you will need to configure smokeping. Find below our sample config in form of a screenshot or download a sample config here.

# vi /opt/smokeping/etc/config


Hint: 10.0.1.251 is the IP of the smokeping host himself.

Create your config from the default config delivered with smokeping and/or use our sample config.

# cd /opt/smokeping/etc
# cp config.dist config
# cp /opt/smokeping/etc/basepage.html.dist /opt/smokeping/etc/basepage.html

Create directories used by smokeping, copy some required files into the public web-directory and set rights for apache user if required.

# mkdir /opt/smokeping/data
# mkdir /opt/smokeping/var
# mkdir /var/www/smokeping
# mkdir /var/www/smokeping/cache
# cp -R /opt/smokeping/htdocs/* /var/www/smokeping
# mv /var/www/smokeping/smokeping.fcgi.dist /var/www/smokeping/smokeping.fcgi
# chown -R apache:apache /var/www/smokeping

Add a virtual apache directory by creating a file on /etc/httpd/conf.d/ with the name smokeping.conf. Add following content to it

Alias /smokeping "/var/www/smokeping"
<Directory /var/www/smokeping>
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex smokeping.fcgi
</Directory>

Restart Apache

# service httpd restart

SELinux

This guide expects SELinux has to be disabled, read following article about disabling SELinux. In case you change your SELinux settings: Make sure you have rebooted your machine to apply the changes.
https://www.centos.org/docs/5/html/5.1/Deployment_Guide/sec-sel-enable-disable.html

Hint: There are untested notes about SELinux within the comments section below.

Run smokeping

To test the installation, execute following command.

# cd /opt/smokeping
# ./bin/smokeping --config=/opt/smokeping/etc/config --debug

To daemonize smokeping, execute following command:

# cd /opt/smokeping
# ./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log

Browse to: http://<your_ipaddress>/smokeping

For additional resources have a visit at the authors website:
– http://oss.oetiker.ch/smokeping/

Special Hint:
In case your graphics for the last 3 hours didnt get updated but all the other timeframes are updated normaly, you may experience an error from the compiler. In this case please try to execute smokeping like this:
# perl /opt/smokeping/bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log

27 thoughts on “How to install SmokePing on CentOS 7

  • Hi, great guide but getting a few issues. At the point of testing smokeping and running in debug i get following error:-

    ./bin/smokeping –config=/opt/smokeping/etc/config –debug
    ERROR: /opt/smokeping/etc/config, line 10: Directory ‘/opt/smokeping/cache’ does not exist

    I created the folder “mkdir /opt/smokeping/cache”

    ran debug again and now get

    ./bin/smokeping –config=/opt/smokeping/etc/config –debug
    ERROR: /opt/smokeping/etc/config, line 111: File ‘/opt/smokeping/etc/smokeping_secrets.dist’ is world-readable or writable, refusing it

    Any help you can offer?

    • >ERROR: /opt/smokeping/etc/config, line 10: Directory ‘/opt/smokeping/cache’ does not exist
      >I created the folder “mkdir /opt/smokeping/cache”
      The creation of the cache directory should be covered by the guide, see: # mkdir /var/www/smokeping/cache
      additionally you have to change the imgcache path within the config file.

      >ERROR: /opt/smokeping/etc/config, line 111: File ‘/opt/smokeping/etc/smokeping_secrets.dist’ is world-readable or writable, refusing it
      On our installation, the ACL of the /opt/smokeping/etc (and all files in this folder) look like this (user root, group root): drwxr-xr-x. 3 root root 172 Jun 21 15:42 etc, probably you have different ACL settings if the file is world-readable or writable.

  • Outstanding guide, Tom! Any advice on properly configuring SELinux for SmokePing?

    Phil, for me disabling SELinux did the trick. I know that is not a good solution, but SELinux does appear to be interfering.

  • Did as the article, but i even cant access the smokeping page. Can anyone please help?

    • Sorted out the previous issue, now it have some issues on the latency page.

      ERROR: opening ‘/opt/smokeping/data/Local/Latency/LocalESX.rrd’: No such file or directory
      ‘DEF:median1=/opt/smokeping/data/Local/Latency/LocalESX.rrd:median:AVERAGE’
      ‘DEF:loss1=/opt/smokeping/data/Local/Latency/LocalESX.rrd:loss:AVERAGE’
      ‘CDEF:ploss1=loss1,20,/,100,*’
      ‘CDEF:dm1=median1,0,100000,LIMIT’

      • Everything working fine, Thanks for the share of knowledge.

        God bless Tom.

  • rrd is created but graph is not generated i changed the file ownership of RRd to apache as well still no graph anywhere to look.

  • I have configured Smokeping, but while entering IP-Address/smokeping/ am getting guest user only. Can you please help me to fix this case

  • Great tutorial, very concise and easy to follow.

    I was just wondering if it was possible to run smokeping as a service? In case the machine loses power it should be able to run the service on boot and continue the daemon.

    Thanks!

    • Add the command to launch smokeping to your /etc/rc.local:
      # echo "cd /opt/smokeping; ./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log" >> /etc/rc.local
      Afterwards make /etc/rc.local executable:
      # chmod +x /etc/rc.local

  • I am getting bellow error,please help to resolve it.
    ERROR: alert startloss (/opt/smokeping/data/Local/LocalMachine) is not defined

  • Everything seemed to work fine for me (with the additional steps in the comments) however, when I use my servername.com/smokeping.cgi it just loads the home page of my server.
    I am also trying to integrate this into LibreNMS, has anyone done this before?

  • ERROR: /opt/smokeping/etc/config, line 2: no variables are allowed

    Centos 7 – I’ve followed the guide to a T, multiple times. Each time when I get to the end and run the smokeping script I get that error. Any suggestions?

  • Hi master,

    Do you know why into directory of 2.7.3 version dont have setup directory with the script: build-perl-modules.sh and sdbs.inc file after selfextract ?

  • Hi thanks your tutorial, it seems i’ve same issued as above, but different matter.
    here is the error:
    Alert “someloss”: no match for target /var/www/html/smokeping/data/Local/Latency/Gateway1

    thanks,
    BR.
    Amri

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.