Friday, August 3, 2012

smokeping 2.6.8 for Centos 6.3

add rpmforge into your linux repo

yum install:

  • mod_fcgid
  • httpd
  • httpd-devel
  • rrdtool
  • perl-CGI-SpedtCGI
  • fping
  • perl-RRD-Simple
  • perl
# yum install mod_fcgid httpd httpd-devel rrdtool perl-CGI-SpeedCGI fping perl-RRD-Simple perl
# yum groupinstall "Development tools"

download the smokeping package from
http://oss.oetiker.ch/smokeping/pub/

# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
# tar -zxvf smokeping-2.6.8.tar.gz
# mv smokeping-2.6.8  /opt/smokeping
# cd smokeping-2.6.8

then manual install perl package manually

#perl -MCPAN -e shell

> install FCGI
> install CGI::Fast
> install Config::Grammar
> install Digest::HMAC_MD5
> install Net::Telnet
> install Net::OpenSSH
> install Net::SNMP
> install Net::LDAP
> install Net::DNS
> install IO::Pty
> install LWP


other from manually install, you can run the script locate at smokeping /opt/smokeping/setup
# cd  /opt/smokeping/setup
# ./build-perl-modules.sh

after done, run to configure and make install
# cd /opt/smokeping
# ./configure --prefix=/opt/smokeping
# make install


now we go for preparing for the configuration file
# cd /opt/smokeping/etc
# for foo in *.dist; do cp $foo `basename $foo .dist`; done

#vim /etc/httpd/conf/httpd.conf

change:
DirectoryIndex index.html index.html.var
to:
DirectoryIndex index.html index.html.var smokeping.fcgi

then enable this
AddHandler cgi-script .cgi

-------------------------------------------------------------------------------------------
# vim /etc/httpd/conf.d/smokeping.conf

<Directory "/var/www/html/smokeping">
    Options +ExecCGI
</Directory>
-------------------------------------------------------------------------------------------

# mkdir /opt/smokeping/img
# chown -R apache.apache /opt/smokeping/img
# ln -s /opt/smokeping/htdocs /var/www/html/smokeping
# ln -s /opt/smokeping/img /var/www/html/smokeping

# mkdir /opt/smokeping/data
# mkdir /opt/smokeping/var
# chmod 600 /opt/smokeping/etc/smokeping_secrets
# chown -R apache.apache /var/www/html/smokeping

restart the httpd
# /etc/init.d/httpd restart

edit the smokeping config to your need
# vim /opt/smokeping/etc/config

start the smokeping services
# ./bin/smokeping --config=/opt/snokeping/etc/config --logfile=smoke.log


Reference and help thanks to Tony from http://ai.net.nz

5 comments:

  1. I have problem with Make Install.
    when i run ./configure --prefix=/opt/smokeping, it should be ok
    .
    .
    .
    checking checking for gnu make availablility... /usr/bin/gmake is GNU make
    checking checking for perl module 'RRDs'... Ok
    checking checking for perl module 'FCGI'... Ok
    checking checking for perl module 'CGI'... Ok
    checking checking for perl module 'CGI::Fast'... Ok
    checking checking for perl module 'Config::Grammar'... Ok
    checking checking for perl module 'Digest::HMAC_MD5'... Ok
    checking checking for perl module 'LWP'... Ok
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating bin/Makefile
    config.status: creating doc/Makefile
    config.status: creating htdocs/Makefile
    config.status: creating etc/Makefile
    config.status: creating lib/Makefile
    config.status: creating etc/config.dist
    config.status: executing depfiles commands

    ** Ready to install Smokeping ******************************

    Settings:

    PERL5LIB = not set
    PERL = /usr/bin/perl

    The Smokeping Makefiles use GNU make functionality.
    Continue installation with

    /usr/bin/gmake install


    Then, when i run make install, it shows me the problem as bellow.


    [root@monitor2 smokeping]# make install
    Making install in bin
    make[1]: Entering directory `/opt/smokeping/bin'
    make[2]: Entering directory `/opt/smokeping/bin'
    test -z "/opt/smokeping/bin" || /bin/mkdir -p "/opt/smokeping/bin"
    /usr/bin/install -c smokeinfo smokeping smokeping_cgi tSmoke '/opt/smokeping/bin'
    /usr/bin/install: `smokeinfo' and `/opt/smokeping/bin/smokeinfo' are the same file
    /usr/bin/install: `smokeping' and `/opt/smokeping/bin/smokeping' are the same file
    /usr/bin/install: `smokeping_cgi' and `/opt/smokeping/bin/smokeping_cgi' are the same file
    /usr/bin/install: `tSmoke' and `/opt/smokeping/bin/tSmoke' are the same file
    make[2]: *** [install-dist_binSCRIPTS] Error 1
    make[2]: Leaving directory `/opt/smokeping/bin'
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/opt/smokeping/bin'
    make: *** [install-recursive] Error 1

    cloud you show me the solution.
    Thanks for advance.

    ReplyDelete
    Replies
    1. Hi SEVEN, sorry was i am away for my holiday.
      so have you solve the problem with help from Matthieu.?

      Delete
  2. HI,

    You have to tape "./Configure" Only

    ReplyDelete
  3. Something is missing. When I go to http:///smokeping/ I get this:

    [TXT] Makefile 09-Nov-2012 19:02 14K
    [TXT] Makefile.am 09-Nov-2012 18:59 1.5K
    [TXT] Makefile.in 09-Nov-2012 18:59 13K
    [DIR] cropper/ 09-Nov-2012 18:59 -
    [DIR] img/ 09-Nov-2012 19:29 -

    Where is the smokeping.cgi?


    Also, what is this command supposed to do? We already have a link to /opt/smokeping/htdocs !
    ln -s /opt/smokeping/img /var/www/html/smokeping

    ReplyDelete
  4. Ok, I managed to install smokeping correctly. This tutorial is good, but has some minor errors.

    1st, disable SELinux:
    setenforce 0

    I used these commands, and it worked fine.

    # wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
    # tar -zxvf smokeping-2.6.8.tar.gz
    # cd smokeping-2.6.8

    # ./configure --prefix=/opt/smokeping
    # make install

    # cd /opt/smokeping/etc
    # for foo in *.dist; do cp $foo `basename $foo .dist`; done


    # cp /opt/smokeping/htdocs/smokeping.fcgi.dist /opt/smokeping/htdocs/smokeping.fcgi


    # mkdir /opt/smokeping/cache
    # chown -R apache.apache /opt/smokeping/cache
    # ln -s /opt/smokeping/htdocs /var/www/html/smokeping
    # ln -s /opt/smokeping/cache /var/www/html/smokeping/img
    # ln -s /opt/smokeping/cache /var/www/html/smokeping/cache


    # mkdir /opt/smokeping/data
    # mkdir /opt/smokeping/var
    # chmod 600 /opt/smokeping/etc/smokeping_secrets
    # chown -R apache.apache /var/www/html/smokeping

    ReplyDelete