网络质量监测Smokepings介绍


http://bbs.linuxtone.org    作者:Tomlinux

一、smokeping介绍:

smokeping是 rrdtool的作者Tobi Oetiker的作品,所以它在图形显示方面有很大优势,也是一个很有特点的opensource工具:多种探测方式,包括fping、 echoping、dig、curl等;可以在多个节点收集同一个监测点的数据;很有特色的alert设置,不只是简单的设置一个阀值;

二、安装包下载:

http://apache.freelamp.com/apr/apr-1.4.2.tar.bz2
http://apache.freelamp.com/apr/apr-util-1.3.9.tar.bz2
http://apache.freelamp.com/httpd/httpd-2.2.15.tar.bz2
http://dag.wieers.com/rpm/packages/echoping/echoping-5.2.0-1.2.el5.rf.x86_64.rpm
http://dag.wieers.com/rpm/packages/fping/fping-2.4-1.b2.2.el5.rf.x86_64.rpm
http://dag.wieers.com/rpm/packages/perl-CGI-SpeedyCGI/perl-CGI-SpeedyCGI-2.22-1.2.el5.rf.x86_64.rpm
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.3.tar.gz
http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz

复制代码

三、安装配置:

yum -y install freetype freetype-devel libpng libpng-devel gd gd-devel libxml2 libxml2-devel libiconv libiconv-devel pango pango-devel qpixman qpixman-devel glib glib-devel cairo cairo-devel libart* gettext gettext-devel libjpeg libjpeg-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC
rpm -ivh echoping-5.2.0-1.2.el5.rf.x86_64.rpm
rpm -ivh fping-2.4-1.b2.2.el5.rf.x86_64.rpm
rpm -ivh perl-CGI-SpeedyCGI-2.22-1.2.el5.rf.x86_64.rpm
useradd -s /sbin/nologon  apache
tar xf apr-1.4.2.tar.bz2   
cd apr-1.4.2   
./configure --prefix=/usr/local/apr   
make   
make install  
tar xf apr-util-1.3.9.tar.bz2   
cd apr-util-1.3.9   
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   
make   
make install  
tar xf httpd-2.2.15.tar.bz2   
cd httpd-2.2.15   
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util   
make   
make install  
tar xf rrdtool-1.4.3.tar.gz   
cd rrdtool-1.4.3
sed -i 's/setlocale(LC_NUMERIC, "C")/setlocale(LC_NUMERIC, "zh_CN.UTF-8")/g' src/rrd_graph.c
./configure --prefix=/usr/local/rrdtool  
make   
make install  
tar xf smokeping-2.4.2.tar.gz   
mv smokeping-2.4.2 /usr/local/smokeping
mkdir /usr/local/smokeping/{cache,var}
sed -i 's/^User daemon/User apache/1;s/^Group daemon/Group apache/1' /usr/local/apache/conf/httpd.conf
echo "Alias /smokeping/ \"/usr/local/smokeping/\"" >>/usr/local/apache/conf/httpd.conf
echo "<Directory "/usr/local/smokeping/">" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tAllowOverride None" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tAddHandler cgi-script cgi" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tOptions ExecCGI" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tOrder allow,deny" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tAllow from all" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo -e "\tDirectoryIndex smokeping.cgi" &gt;&gt;/usr/local/apache/conf/httpd.conf
echo "</Directory>" &gt;&gt;/usr/local/apache/conf/httpd.conf
rm -f /etc/init.d/httpd
/bin/cp  -rp /usr/local/apache/bin/apachectl /etc/init.d/httpd
sed -i '2a #chkconfig: 2345 10 90\n#description: Activates/Deactivates Apache Web Server' /etc/init.d/httpd
chmod 755 /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 3 httpd on
/etc/init.d/httpd start
/bin/cp -rp tr.cgi /usr/local/smokeping/htdocs/
chmod u+s /bin/traceroute
rm -f /usr/local/smokeping/bin/smokeping.dist
rm -f /usr/local/smokeping/etc/config.dist
rm -f /usr/local/smokeping/htdocs/somkeping.cgi
rm -f /usr/local/smokeping/htdocs/tr.cgi
/bin/cp -rp smokeping.dist /usr/local/smokeping/bin/
/bin/cp -rp config.dist /usr/local/smokeping/etc/
/bin/cp -rp smokeping.cgi /usr/local/smokeping/htdocs/
/bin/cp -rp smokeping /etc/init.d/
chmod 755 /etc/init.d/smokeping
chown -R apache:apache /usr/local/smokeping
chmod -R +x /usr/local/smokeping/bin
chmod -R +x /usr/local/smokeping/htdocs 

复制代码

安装完成

访问地址:http://ip/smokeping/htdocs/smokeping.cgi

总结:以下三点

1、
安装前yum -y install freetype freetype-devel libpng libpng-devel gd gd-devel libxml2 libxml2-devel libiconv libiconv-devel pango pango-devel qpixman qpixman-devel glib glib-devel cairo cairo-devel libart* gettext gettext-devel libjpeg libjpeg-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC

否则启动时会出现一些perl的问题

2、config.dist的配置文件

*** Targets ***

probe = FPing

menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
         Here you will learn all about the latency of our network.
menuextra = <a target='_blank' href='tr.html{HOST}' class='{CLASS}'>*</a>

3、rrdtool让图片显示中文

   rrdtools 需要1.4以上的版本;

安装如下:

tar xf rrdtools.1.4.x.x && cd rrdtools.1.4.x

sed -i 's/setlocale(LC_NUMERIC, "C")/setlocale(LC_NUMERIC, "zh_CN.UTF-8")/g' src/rrd_graph.c
./configure --prefix=/usr/local/rrdtools && make && make install

4、用tr.html页面报错:

用chmod u+s /bin/traceroute

需要的朋友可以下载PDF

效果图:

4.JPG (42.59 KB, 下载次数: 1)

2010-9-27 12:38 上传

下载次数: 1

网络质量监测Smokepings_监测 网络质量监测Smokepings_休闲_02

tracertoute

网络质量监测Smokepings_质量_03

1.JPG (43.38 KB, 下载次数: 0)

2010-9-27 12:38 上传

下载次数: 0

网络质量监测Smokepings_监测 网络质量监测Smokepings_休闲_02

全图

网络质量监测Smokepings_Smokepings_06

2.JPG (52.66 KB, 下载次数: 0)

2010-9-27 12:39 上传

下载次数: 0

网络质量监测Smokepings_监测 网络质量监测Smokepings_休闲_02

实实监测

网络质量监测Smokepings_休闲_09

3.JPG (39.85 KB, 下载次数: 0)

2010-9-27 12:39 上传

下载次数: 0

网络质量监测Smokepings_监测 网络质量监测Smokepings_休闲_02

十天监测

网络质量监测Smokepings_Smokepings_12

5.JPG (63.9 KB, 下载次数: 0)

2010-9-27 15:23 上传

下载次数: 0

网络质量监测Smokepings_监测 网络质量监测Smokepings_休闲_02

图解

网络质量监测Smokepings_网络_15

网络质量监测Smokepings_网络_16

config.rar

2010-9-27 12:42 上传

下载次数: 35

7.61 KB, 下载次数: 35

网络质量监测Smokepings_网络_17

网络质量监测Smokeping介绍.pdf

2010-9-27 15:29 上传

下载次数: 55

582.73 KB, 下载次数: 55