How to install and configure smokeping on CentOS 6 or CentOS 5?

Categories: How to
Comments: 18 Comments
Published on: November 18, 2012

Smokeping is a very useful network monitoring tool but it’s also very complicated to install and configure.

Here are the steps for installing smokeping on CentOS 6 or CentOS 5.
To make it easier to deploy we recommend to temporarily disable selinux with this command:
setenforce 0

1 – Install rpmforge

# yum install wget
* For CentOS 6 please use this repository:
# wget https://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
* For CentOS 5 please use this repository:
# wget https://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

2 – Install required packages

# yum install mod_fcgid httpd httpd-devel rrdtool fping wget curl bind-utils gcc make

3 – Install more packages

# yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-RRD-Simple perl-CGI-SpeedCGI perl-ExtUtils-MakeMaker

[gard]

4 – Install smokeping

# wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
* You should check on smokeping website for the latest version.

# tar -zxvf smokeping-2.6.8.tar.gz -C /opt/
# mkdir /opt/smokeping
# cd /opt/smokeping-2.6.8/setup
# ./build-perl-modules.sh
# cp -r ../thirdparty /opt/smokeping/
# cd ..
# ./configure –prefix=/opt/smokeping
* There are twice – before the prefix so it is –prefix.
# make install

5 – Create missing folders
# cd /opt/smokeping
# mkdir data var cache

6 – Add smokeping start/stop script
# wget https://www.wedebugyou.com/static/smokeping_start_stop.txt
# mv smokeping_start_stop.txt /etc/init.d/smokeping
# chmod 755 /etc/init.d/smokeping

Here are the steps for configuring smokeping.

1 – Rename config files and change security
# cd /opt/smokeping/etc/
# for foo in *.dist; do cp $foo `basename $foo .dist`; done
# chmod 600 /opt/smokeping/etc/smokeping_secrets.dist

2 – Change the default config files
# vi config

Change the values in bold to something that fit your needs.

owner    = Peter Random
contact  = some@address.nowhere
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is not
# good for images.
imgcache = /opt/smokeping/cache
imgurl   = cache
datadir  = /opt/smokeping/data
piddir  = /opt/smokeping/var
cgiurl   = http://some.url/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail.dist
tmail = /opt/smokeping/etc/tmail.dist

Here is an example:

owner    = Jean Debogue
contact  = noc@jeandebogue.com
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is not
# good for images.
imgcache = /opt/smokeping/cache
imgurl   = cache
datadir  = /opt/smokeping/data
piddir  = /opt/smokeping/var
cgiurl   = http://graph.mydomain.com/smokeping/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail.dist
tmail = /opt/smokeping/etc/tmail.dist

3 – Configure smokeping into the webserver
# cd /opt/smokeping
# ln -s /opt/smokeping/cache /opt/smokeping/htdocs/cache
# chown -R apache cache
# chown -R apache data

Add these lines into the file /etc/httpd/conf.d/smokeping.conf
ScriptAlias /smokeping/smokeping.cgi /opt/smokeping/htdocs/smokeping.fcgi.dist
Alias /smokeping /opt/smokeping/htdocs

<Directory “/opt/smokeping/htdocs”>
Options FollowSymLinks
</Directory>

4 – Start smokeping
# /etc/init.d/smokeping start
# /etc/init.d/httpd start

5 – Expect the worst hope for the best
If there are no error message you are in a very good position. You can now browse to the webpage you configure in the config file cgiurl = http://graph.mydomain.com/smokeping/smokeping.cgi.

[gard]

Here are the steps to add your own configuration

1 – Add your own host in the config file
It’s quite complicated to explain all the details of smokeping configuration file. The best is to read their documentation or check the many examples available online. You can also use our example config file. Just paste this file under the line *** Probes *** in your config file. Our example contains an icmp probe, a dns check, a check on port 80 and a full fetch of the default webpage of www.google.com.

2 – Restart smokeping
After changing the config file, it is important to restart smokeping with this command:
# /etc/init.d/smokeping restart

3 – Clean installation files
# rm -rf /opt/smokeping-2.6.8

4 – Enable smokeping to start automatically on reboot
# chkconfig –add smokeping
* There are twice – before the add so it is –add.
# chkconfig httpd on
# chkconfig smokeping on

smokeping graph

You can now also use smokeping. Do you also use smokeping? Do you monitor routers, servers, websites? Do you use it into a master/slave mode? We would like to hear from you how you use smokeping in your day to day life.

[gard]

How to install and configure smokeping on CentOS 6 or CentOS 5? was last modified: February 15th, 2018 by Jean Debogue
The following two tabs change content below.
Jean Debogue

Jean Debogue

IT consultant at Wedebugyou
I am a Canadian that lived a couple of years in Austria. My several years of experience in IT permits me to deliver quality solutions that scale for my clients. I am an expert in ipv6, security, web hosting, cloud and any kind of IT solutions. I am able to solve problems of great complexity. I like challenges and I always enjoy the process of achieving a successful outcome.
18 Comments
  1. I view something genuinely interesting about your web blog so I saved to fav.

  2. Great paintings! That is the type of info that are meant to be shared around the web. Disgrace on the seek engines for not positioning this publish higher! Come on over and consult with my website . Thank you =)

  3. episode says:

    Excellent weblog right here! Additionally your website a lot up very fast! What host are you the use of? Can I get your affiliate link to your host? I desire my site loaded up as fast as yours lol

  4. We are a group of volunteers and opening a brand new scheme in our community. Your site provided us with useful information to paintings on. You have performed a formidable task and our whole community can be grateful to you.

  5. Ivan M says:

    Nice one Jean, might give it a go and see what i see.

  6. Say, you got a nice article post.Much thanks again. Awesome.

  7. Wow, that looks so good!Dialect mayhap you have changed your point not too covet ago? For all practical purposes because I could contain sworn it was not the having said that the antecedent time I was here

  8. cyberhusky says:

    Great tutorial that actually works! This is the most accurate one you’ll find about installing smokeping. I would also like to add that you need to install the epel repo in order to install “mod_fcgid”.
    This is done through:

    #rpm –import https://fedoraproject.org/static/0608B895.txt
    #wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
    #rpm -ivh epel-release-6-7.noarch.rpm

    • Jean Debogue jeandebogue says:

      I like the part of your comment that says

      that actually works!

      When I wrote it I was very carefull to write every steps. When it was finished I tried my own medicine on a fresh VM and… it didn’t work. I applied some fixes then push the publish button.

      I like complete guide that work and this one is working. :)

      Thanks again

  9. I cling on to listening to the news broadcast lecture about getting boundless online grant applications so I have been looking around for the top site to get one. Could you advise me please, where could i find some?

  10. Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! By the way, how can we communicate?
    louis vuitton bags http://louisvuittonbags127.webeden.co.uk

  11. How to install and configure smokeping on CentOS 6? | We debug you Subscribed for your weblog, thanks

  12. Dear,

    Very nice and useful howto! I just got one problem…i think that i did a misconfiguration in my httpd files. When i want to visit smokeping.noc2go.eu/cgi-bin/smokeping.fcgi or smokeping.noc2go.eu/smokeping.fcgi the machine gives me a 404 “not found” error

    • Jean Debogue jeandebogue says:

      Hello Kris,

      You are absolutely right that it doesn’t work!

      Try this instead http://smokeping.noc2go.eu/smokeping/smokeping.cgi

      I changed a little bit the configuration after posting it, base on the recommendations of Tobi.

      Apparently, the new way is better. There was a part not well updated… It’s fix now!

      I just browsed your smokeping setup. Good job!

      I am happy to hear this post was useful.

      Cheers

Comments are closed.

Welcome , today is Saturday, November 23, 2024