Home » code snippets, geek, servers & tech

CentOS 5.3 Smokeping 2.4.2 Install (quick)

Submitted by Carl on Monday, 29 June 20099 Comments

Install the latest smokeping (without distributed polling) on a virgin Centos 5.3 minimal box… It’s probably the best (free) tool for monitoring network latency at a glance.

Examples: Pipe Ten Derby and Pipe Ten Sheffield.

Install all of the smokeping prerequisites:

wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uv rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rm rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum update
yum install rrdtool perl-CGI-SpeedyCGI fping httpd perl-libwww-perl.noarch fontconfig freetype dejavu-lgc-fonts.noarch

Install and configure smokeping 2.4.2:

wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz
tar xvzf smokeping-2.4.2.tar.gz
mv smokeping-2.4.2 /usr/local/smokeping
chown -R root:root /usr/local/smokeping
cd /usr/local/smokeping/bin
for foo in *.dist; do cp $foo `basename $foo .dist`; done
cd  /usr/local/smokeping/etc/
for foo in *.dist; do cp $foo `basename $foo .dist`; done
cd /usr/local/smokeping/htdocs
for foo in *.dist; do cp $foo `basename $foo .dist`; done
vi /usr/local/smokeping/bin/smokeping

  • change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);
  • to > use lib qw(/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs);
  • change > use lib qw(lib);
  • to > use lib qw(/usr/local/smokeping/lib);
  • change > Smokeping::main(“etc/config.dist”);
  • to > Smokeping::main(“/usr/local/smokeping/etc/config”);

vi /usr/local/smokeping/htdocs/smokeping.cgi

  • change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);
  • to > use lib qw(/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs);
  • change > use lib qw(/home/oetiker/checkouts/smokeping/trunk/software/lib);
  • to > use lib qw(/usr/local/smokeping/lib);
  • change > Smokeping::cgi(“/home/oetiker/checkouts/smokeping/trunk/software/etc/config.dist”);
  • to > Smokeping::cgi(“/usr/local/smokeping/etc/config”);

cp /usr/local/smokeping/htdocs/smokeping.cgi /var/www/cgi-bin
vi /usr/local/smokeping/etc/config

  • change > owner | contact | mailhost
  • to > what they should be
  • change > imgcache = /home/oetiker/public_html/smokeping-ms/cache
  • to > imgcache = /var/www/html/smokeping/img
  • change > imgurl   = cache
  • to > imgurl = http://smoke.pipeten.co.uk/smokeping/img
  • change > datadir  = /tmp/smokeping-ms/data
  • to > datadir = /usr/local/smokeping/var
  • change > piddir  = /tmp/smokeping-ms/var
  • to > piddir = /usr/local/smokeping/var
  • change > cgiurl   = http://some.url/smokeping.cgi
  • to > cgiurl = http://mail.somewhere.net/cgi-bin/smokeping.cgi
  • change > smokemail = /home/oetiker/checkouts/smokeping/trunk/software/etc/smokemail.dist
  • to > smokemail = /usr/local/smokeping/etc/smokemail
  • change > tmail = /home/oetiker/checkouts/smokeping/trunk/software/etc/tmail.dist
  • to > tmail = /usr/local/smokeping/etc/tmail
  • change > template = /home/oetiker/checkouts/smokeping/trunk/software/etc/basepage.html.dist
  • to > template = /usr/local/smokeping/etc/basepage.html
  • change > binary = /usr/sbin/fping
  • to > binary = /usr/sbin/fping
  • comment out (#) the “*** Slaves ***” section
  • comment out or remove everything below “*** Targets ***” > remark (don’t remove probe, menu, title)
  • You’ll need to add your targets before you can do anything useful with smokeping.

mkdir -p /var/www/html/smokeping/img
chown -R apache:apache /var/www/html/smokeping/img
mkdir /usr/local/smokeping/var
/usr/local/smokeping/bin/smokeping &

Visit http://some.url/cgi-bin/smokeping.cgi in a web browser and check that you’re not getting an error 500 (check your SELinux config).

Optional SmokeTrace install & configure:
vi /var/www/html/.htaccess

  • add > AddHandler cgi-script cgi
  • add > Options ExecCGI

mkdir /var/www/html/script/
cp /usr/local/smokeping/htdocs/script/Tr.js /var/www/html/script/
cp -rf /usr/local/smokeping/htdocs/resource/ /var/www/html/
cp -rf /usr/local/smokeping/htdocs/cropper/ /var/www/html/
vi /usr/local/smokeping/etc/config

  • add below “*** Targets ***” > menuextra = <a target=’_blank’ href=’/tr.html{HOST}’ class=’{CLASS}’ \
  • onclick=”window.open(this.href,this.target, \
  • ‘width=800,height=500,toolbar=no,location=no,status=no,scrollbars=no’); \
  • return false;”>*</a>

vi /etc/httpd/conf/httpd.conf

  • change > #AddHandler cgi-script .cgi
  • to > AddHandler cgi-script .cgi
  • change > Options Indexes FollowSymLinks
  • to > Options Indexes FollowSymLinks ExecCGI

vi /usr/local/smokeping/etc/basepage.html

  • (Below is just adding / before cropper/* on the .js includes)
  • change > <script src=”/cropper/lib/prototype.js” type=”text/javascript”></script>
  • to > <script src=”/cropper/lib/prototype.js” type=”text/javascript”></script>
  • change > <script src=”/cropper/lib/scriptaculous.js?load=builder,dragdrop” type=”text/javascript”></script>
  • to > <script src=”/cropper/lib/scriptaculous.js?load=builder,dragdrop” type=”text/javascript”></script>
  • change > <script src=”/cropper/cropper.js” type=”text/javascript”></script>
  • to > <script src=”/cropper/cropper.js” type=”text/javascript”></script>
  • change > <script src=”/cropper/smokeping-zoom.js” type=”text/javascript”></script>
  • to > <script src=”/cropper/smokeping-zoom.js” type=”text/javascript”></script>

vi /var/www/html/tr.cgi

  • change > #!/usr/sepp/bin/speedy-5.8.8 -w
  • to > #!/usr/bin/speedy
  • change > use lib qw(/home/oposs/smokeping/software/lib);
  • to > use lib qw(/usr/local/smokeping/lib);

chmod 4755 /bin/traceroute
killall smokeping
/usr/local/smokeping/bin/smokeping
/etc/init.d/httpd restart
UPDATE (missed items from original post):
cp /usr/local/smokeping/htdocs/tr.html /var/www/html/

Targets

9 Comments »

  • Martin said:

    hello,

    2 mistakes

    cropper installation is missing
    imgurl must point to the local webserver

    regards

  • sclebo05 said:

    works well! I would change:

    to > imgurl = http://smoke.pipeten.co.uk/smokeping/img

    to this:

    to > imgurl = http://some.url/smokeping/img

    Thanks!

  • Carl (author) said:

    Hi Martin,
    I had no problem with imgurl being remote… I’ve lost my bash history for the install now so not sure about cropper.

    Thanks

  • Gza said:

    Hi,

    Mine is not working, i’ve got an error when i execute /usr/local/smokeping/bin/smokeping, and that is

    Can’t locate RRDs.pm in @INC (@INC contains: /usr/local/smokeping/lib /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/RRDs /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/smokeping/lib/Smokeping.pm line 13.
    BEGIN failed–compilation aborted at /usr/local/smokeping/lib/Smokeping.pm line 13.
    Compilation failed in require at /usr/local/smokeping/bin/smokeping line 10.
    BEGIN failed–compilation aborted at /usr/local/smokeping/bin/smokeping line 10.

    Someone help.

    Thanks!

  • Carl (author) said:

    Try this some of the suggestions in http://ubuntuforums.org/showthread.php?t=304085 and check that rrdtool installed correctly. I don’t believe I came across this error with my installs.

  • Gza said:

    It works now, i think it was because of perl. cuz i reinstalled it, and then … bang … it is working :)
    Now I want to know something else :) (if it is posible) …. i want to personalize the mail that I recive from smokeping, to be more friendly, cuz’ i want to put a person to receive the mail and he doesn’t how to interprete the results, and to add some other text.

    Thanks!

  • GanGan said:

    hello all,

    I followed this howto, but as you can see all my graphs are empty

    http://smokeping.system-linux.eu/smokeping.cgi?target=_charts

    an idée ?

  • raulkang said:

    Hi,

    Mine is not working, i’ve got an error:

    [root@smokeping smokeping]# /usr/local/smokeping/bin/smokeping –debug
    ### Compiling alert detector pattern ’someloss’
    ### >0%,*12*,>0%,*12*,>0%
    sub {
    my $d = shift;
    my $y = $d->{loss};
    for(1){
    my $imax2 = min(@$y – 3, 12);
    my $imax1 = min(@$y – 3, 12);
    my $minlength = 3;
    my $maxlength = 27;
    next if scalar @$y < $minlength ;
    my $i1;
    for($i1=0; $i1 < min($maxlength,$imax1); $i1++){
    my $i2;
    for($i2=0; $i2 [-3-$i1-$i2]
    and $y->[-3-$i1-$i2] =~ /^\d/
    and $y->[-3-$i1-$i2] > 0;
    last;
    }
    return 0 if $i2 >= min($maxlength-$i1-$i2,$imax2);
    next unless defined $y->[-2-$i1]
    and $y->[-2-$i1] =~ /^\d/
    and $y->[-2-$i1] > 0;
    last;
    }
    return 0 if $i1 >= min($maxlength-$i1,$imax1);
    next unless defined $y->[-1]
    and $y->[-1] =~ /^\d/
    and $y->[-1] > 0;
    return 1;
    }
    return 0;
    }

    ERROR: unknown hierarchy owner in /usr/local/smokeping/var. Make sure it is listed in Presentation->hierarchies

    Thanks!

  • Carl (author) said:

    It sounds like you have an error in the configuration file.

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.