小试 smokeping

好久之前老大让使用smokeping时的安装笔记,当时还说后续要再研究下,看样子以后不会再用这货了,就这样吧,记录到博客,需要时再看看。

简单的笔记,待丰富…

系统环境:

CentOS 6.4 x86_64

1.安装epel源

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

2.安装rrdtool与依赖库

yum -y 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-CGI-SpeedCGI perl-Time-HiRes perl-ExtUtils-MakeMaker perl-RRD-Simple rrdtool rrdtool-perl curl fping echoping  httpd httpd-devel gcc make  wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel mod_fastcgi

3.下载与安装smokeping

wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.9.tar.gz
tar zxvf smokeping-2.6.9.tar.gz
./configure --prefix=/usr/local/smokeping
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty

安装过程中,可能会出现下面的提示:
** Aborting Configure ******************************

   If you know where perl can find the missing modules, set
   the PERL5LIB environment variable accordingly.

   FIRST though, make sure that 'perl' starts the perl
   binary you want to use for SmokePing.

   Now you can install local copies of the missing modules
   by running

     ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty

   The RRDs perl module is part of RRDtool. Either use the rrdtool
   package provided by your OS or install rrdtool from source.
   If you install from source, the RRDs module is located
   PREFIX/lib/perl

这是以为缺少相应的perl模块,按照提示来就可以了:
  ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install

4、配置smokeping

a.创建cache、data、var目录
cd /usr/local/smokeping
mkdir cache datavar

b.在创建日志
touch /var/log/smokeping.log

c.授权
chown apache:apache cache data var
chown apache:apache /var/log/smokeping.log

d.修改配置文件
cd /usr/local/smokeping/htdocs/
mv smokeping.fcgi.dist smokeping.fcgi
cd /usr/local/smokeping/etc
mv config.dist config
cgiurl   = http://192.168.0.8:9999/smokeping.cgi

e.配置完成之后修改密码文件权限
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

f.修改apache的配置
vim /etc/httpd/conf/httpd.conf
添加如下
Alias /cache"/usr/local/smokeping/cache/"
Alias /cropper"/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping"/usr/local/smokeping/htdocs/smokeping.fcgi"
<Directory"/usr/local/smokeping">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
Order allow,deny
Allow from all
DirectoryIndex smokeping.fcgi
</Directory>

g.设置开机启动
echo"/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &">> /etc/rc.local

h.启动http与smokeping
/etc/init.d/httpd start
/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log2>&1&

5.最后访问:http://192.168.0.8:9999/smokeping


参考资料:

吟—技术交流:http://dl528888.blog.51cto.com/2382721/1266598

smokeping官网:http://oss.oetiker.ch/smokeping/index.en.html

Keep fighting:http://blog.coocla.org/293.html

cu论坛:http://bbs.chinaunix.net/thread-1616296-1-1.html

小猫窝:http://www.joecen.com/2008/10/09/use-smokeping/

github 地址:https://github.com/oetiker/SmokePing