Smokeping 是一款用於網路效能監測的監視軟體,通過它可以在自己公司IDC的網路狀況,如延時,丟包率,是否BGP多線等,通過rrdtool製圖方式,圖形化地展示網路的時延情況,進而能夠清楚的判斷出網路的即時通訊情況,
Smokeping 需要多個包的支援,下面我們逐個安裝,這裡通過yum和編譯安裝兩種方式。(有內建yum包直接yum,沒有的編譯安裝)
yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl 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
下載fping並編譯:
wget http://fping.org/dist/fping-3.10.tar.gz
解壓縮後,直接 configure && make && make install 即可
下載echoping並編譯安裝:
wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.2/echoping-6.0.2.tar.gz
yum install -y popt
yum install -y libidn (安裝兩個echoping依賴的包)
解壓縮後,直接 configure && make && make install 即可
下載smokeping
http://download.csdn.net/download/fairplay_li/8711829
解壓; cd smokeping-2.6.9
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install
以下開始配置 smokeping
cd /usr/local/smokeping/mkdir cache data vartouch /var/log/smokeping.log chown apache:apache cache data varchown apache:apache /var/log/smokeping.logchmod 600 /usr/local/smokeping/etc/smokeping_secrets.distcd /usr/local/smokeping/htdocs mv smokeping.fcgi.dist smokeping.fcgicd /usr/local/smokeping/etcmv config.dist config
vim config
主要修改如下內容:
cgiurl = http://some.url/smokeping.cgi
*** Database *** step = 300 此處建議改為 60 , 一分鐘採集一次資料
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 NoneOptions AllAddHandler cgi-script .fcgi .cgiOrder allow,denyAllow from allDirectoryIndex smokeping.fcgi</Directory>
如果需要支援中文,需要安裝中文編碼:
yum -y install wqy-zenhei-fonts.noarch
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
後,添加 '--font TITLE:20:"WenQuanYi Zen Hei Mono"',
設定開機啟動 echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local
監測源的IP庫,填入到 config 中
+ Othermenu = 三大網路監控title = 監控統計++ dianxinmenu = 電信網路監控title = 電信網路監控列表host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj /Other/dianxin/dianxin-tj /Other/dianxin/dianxin-sc /Other/dianxin/dianxin-sh /Other/dianxin/dianxin-gz+++ dianxin-bj menu = 北京電信title = 北京電信alerts = somelosshost = 202.96.199.133+++ dianxin-hlj menu = 黑龍江電信title = 黑龍江電信alerts = somelosshost = 219.147.198.242+++ dianxin-tjmenu = 天津電信title = 天津電信alerts = somelosshost = 219.150.32.132+++ dianxin-sc menu = 四川電信title = 四川電信alerts = somelosshost = 61.139.2.69+++ dianxin-sh menu = 上海電信title = 上海電信alerts = somelosshost = 116.228.111.118+++ dianxin-gz menu = 廣東電信title = 廣東電信alerts = somelosshost = 113.111.211.22++ liantongmenu = 聯通網路監控title = 聯通網路監控列表host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /Other/liantong/liantong-tj /Other/liantong/liantong-sc /Other/liantong/liantong-sh /Other/liantong/liantong-gz+++ liantong-bj menu = 北京聯通title = 北京聯通alerts = somelosshost = 61.135.169.121+++ liantong-hlj menu = 黑龍江聯通title = 黑龍江聯通alerts = somelosshost = 202.97.224.69+++ liantong-tjmenu = 天津聯通title = 天津聯通alerts = somelosshost = 202.99.96.68+++ liantong-sc menu = 四川聯通title = 四川聯通alerts = somelosshost = 119.6.6.6+++ liantong-sh menu = 上海聯通title = 上海聯通alerts = somelosshost = 210.22.84.3+++ liantong-gz menu = 廣東聯通title = 廣東聯通alerts = somelosshost = 221.5.88.88++ yidong menu = 移動網路監控title = 移動網路監控列表host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj /Other/yidong/yidong-sc /Other/yidong/yidong-sh /Other/yidong/yidong-gz+++ yidong-bj menu = 北京移動title = 北京移動alerts = somelosshost = 221.130.33.52+++ yidong-hlj menu = 黑龍江移動title = 黑龍江移動alerts = somelosshost = 211.137.241.35+++ yidong-tjmenu = 天津移動title = 天津移動alerts = somelosshost = 211.137.160.5+++ yidong-sc menu = 四川移動title = 四川移動alerts = somelosshost = 218.201.4.3+++ yidong-sh menu = 上海移動title = 上海移動alerts = somelosshost = 117.131.19.23+++ yidong-gz menu = 廣東移動title = 廣東移動alerts = somelosshost = 211.136.192.6