# 公司新拉了一個線路,需要測試網絡品質以及丢包率,找了許久才找着有smokeping這款軟體
以下主要功能 _用于監控公司網絡品質,位址都使用的是各地的教育網位址,還有各地機房連接配接
el7也有一鍵安裝,源碼包比較費勁:一部分依賴包,拉至最下面有安裝
<a href="https://s2.51cto.com/wyfs02/M00/9B/2A/wKiom1le_07T9wKjAAEQMx1Dn6M177.png" target="_blank"></a>
下載下傳:http://pan.baidu.com/s/1hrJiLBA
安裝可以使用yum包一鍵安裝 系統el6
各種依賴包:rrdtool-perl perl-Config-Gramar rrdtool
# 這裡配置一直到效果圖都是使用的el6的系統
安裝完之後需要配置apache 否則登陸會有權限問題:
修改:/etc/httpd/conf.d/smokeping.conf
<Directory "/usr/share/smokeping" >
# Order allow,deny
Allow from 192.168.x.0/24 允許通路的位址
Deny from all
</Directory>
<Directory "/var/lib/smokeping" >
Allow from 192.168.x.0/24
smokeping 配置:/etc/smokeping/config
配置如下
*** General ***
owner = Super User
contact = root@localhost
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
imgcache = /var/lib/smokeping/images
imgurl = /smokeping/images
datadir = /var/lib/smokeping/rrd
piddir = /var/run/smokeping
cgiurl = http://localhost/smokeping/sm.cgi
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no
*** Alerts ***
to = root@localhost
from = root@localhost
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
*** Database ***
step = 200
pings = 15
# consfn mrhb steps total
AVERAGE 0.5 1 1008
AVERAGE 0.5 12 4320
MIN 0.5 12 4320
MAX 0.5 12 4320
AVERAGE 0.5 144 720
MAX 0.5 144 720
MIN 0.5 144 720
*** Presentation ***
template = /etc/smokeping/basepage.html
charset = utf-8
+ charts
menu = Charts
title = The most interesting destinations
++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds
+ overview
width = 600
height = 50
range = 10h
+ detail
height = 200
unison_tolerance = 2
"Last 1 Hours" 1h
"Last 3 Hours" 3h
"Last 5 Hours" 5h
"Last 30 Hours" 30h
"Last 10 Days" 10d
"Last 30 Days" 30d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/sbin/fping
*** Slaves ***
secrets=/etc/smokeping/smokeping_secrets
+boomer
display_name=boomer
color=0000ff
+slave2
display_name=another
color=00ff00
*** Targets ***
#menuextra = <a target='_blank' href='/smokeping/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>
#
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of <b>Insert Company Name Here</b>. \
Here you will learn all about the latency of our network.
+ Ping
menu = TEST
title = test
++ baidu
menu = baidu
title = baidu
host = 115.239.210.27
++ sohu
menu = sohu
title = sohu
host = 42.81.12.126
+ ALL_JYW
menu = 全國各地教育網位址
title = ALL_JYW_IP
++ TJYYDX
menu = 同濟醫藥大學
title = 同濟醫藥大學
host = 202.114.128.1
++ ZNCJDX
menu = 中南财經大學
title = 中南财經大學
host = 202.114.224.1
++ WHKJDX
menu = 武漢科技大學
title = 武漢科技大學
host = 202.114.240.1
++ DZKJDX
menu = 電子科技大學
title = 電子科技大學
host = 202.115.000.1
++ SCGYXY
menu = 四川工業學院
title = 四川工業學院
host = 202.115.144.1
++ XLGXY
menu = 西南工學院
title = 西南工學院
host = 202.115.160.1
++ SKLYDX
menu = 四川農業大學
title = 四川農業大學
host = 202.115.176.1
++ GD
menu = 廣東
title = 廣東
host = 202.116.224.1
++ GGYKDX
menu = 中國醫藥大學
title = 中國醫藥大學
host = 202.118.040.1
++ HRBSFDX
menu = 哈爾濱師範大學
title = 哈爾濱師範大學
host = 202.118.128.1
++ HRBGCDX
menu = 哈爾濱工程大學
title = 哈爾濱工程大學
host = 202.118.176.1
++ LJXZSFXX
menu = 南京曉莊師範學校
title = 南京曉莊師範學校
host = 202.119.133.1
++ LJDLGDZKXJ
menu = 南京電力高等專科學校
title = 南京電力高等專科學校
host = 202.119.160.1
++ JSSJYWYH
menu = 江蘇省教育委員會
title = 江蘇省教育委員會
host = 202.119.172.1
++ LJLKDX
menu = 南京林業大學
title = 南京林業大學
host = 202.119.208.1
++ SHJTDX
menu = 上海交通大學
title = 上海交通大學
host = 202.120.000.1
++ SHYKDX
menu = 上海醫藥大學
title = 上海醫藥大學
host = 202.120.064.1
#安裝完之後直接重新開機httpd跟smokeping就能通路了 通路位址:
<a href="http://blog.51cto.com/smokeping/sm.cgi">http://安裝機器ip/smokeping/sm.cgi</a>
效果圖:
<a href="https://s3.51cto.com/wyfs02/M00/9B/29/wKioL1le_sChpCaVAAG-1qM-5dU350.png" target="_blank"></a>
<a href="https://s2.51cto.com/wyfs02/M01/9B/29/wKioL1le_u2D7plWAADnIl5EnK4843.png" target="_blank"></a>
# 安裝配置
2:http://sr2009.blog.51cto.com/742434/1151064
el7的安裝
yum -y installrrdtool fping echoping curl dig openssh bind perl fcgi popt-devel popt libidn libidn-develfcgi fcgi-devel perl-devel
# 安裝系統元件包
yum install gccfreetype-devel zlib-devel libpng-devel libart_lgpl-devel httpd-develapr-util-devel apr-devel cairo cairo-devel pango pango-devel libxml2libxml2-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC
# 安裝perl插件包
yum-y install lperl-IO-Socket-SSL perl-Net-DNS perl-Socket6 perl-CGI perl-FCGI perl-Config-Grammar perl-libwww-perl perl-Net-Telnet perl-Net-OpenSSHperl-Authen-Radius perl-Net-IP perl-Data-HexDump perl-ExtUtils-Embedperl-Net-SNMP perl-CPANperl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-ExtUtils-Manifest perl-CGI perl-FCGIperl-Sys-Syslog
安裝cgilib
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make
cp libcgi.a /usr/local/lib
cp cgi.h /usr/include
安裝echoping
#下載下傳位址:http://down.51cto.com/data/612292
tar zxvf echoping-6.0.0.tar.gz
cd echoping-6.0.0
./configure
make test
make install
安裝smokeping
tarxf SmokePing-2.6.11.tar.gz
bash release-smokeping.sh
tarxf IO-Tty-1.07.tar.gz
cd IO-Tty-1.07
perlMakefile.PL
make-j 2 && make -j install
tarxf perl-ldap-0.56.tar.gz
cdperl-ldap-0.56
#安裝smokeping
[root@db3 SmokePing-2.6.11]#./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
[[email protected]]# ./configure --prefix=/usr/local/smokeping
[[email protected]]# gmake install
常見問題解決
# 解決
configure:error: Get the GNU libidn library (http://www.josefsson.org/libidn/) in orderto use Unicode - multi-script - domain names or use --without-libidn to disableit
# 解決方法:安裝libidn-devel
# 安裝smokeping 問題一:
Can'tlocate ExtUtils/Manifest.pm in @INC (@INC contains:FatPacked::19757960=HASH(0x12d7b88)/tmp/smokeping-24859-build/thirdparty/lib/perl5 /usr/local/lib64/perl5/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at/tmp/smokeping-24859-build/thirdparty/bin/cpanm line 132
解決方法:.安裝yum -y install perl-ExtUtils-Embed
Can'tlocate Sys/Syslog.pm in @INC (@INC contains:
解決方法:.安裝yum -y install perl-Sys-Syslog
checkingchecking for perl module 'Net::LDAP'... Can't locate Net/LDAP.pm in @INC
安裝:net-ldap軟體包
下載下傳位址:http://www.cpan.org/authors/id/M/MA/MARSCHAP/perl-ldap-0.56.tar.gz
Can'tlocate CPAN.pm in @INC (@INC contains: inc /usr/local/lib64/perl5/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) atinc/Module/AutoInstall.pm line 277.
# 安裝yum -y install perl-CPAN.
Can'tlocate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) atMakefile.PL line 3.
# 安裝yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker -y
Can'tlocate ExtUtils/Manifest.pm in @INC (@INC contains: ./lib/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at/usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm line 825.
yum-y install perl-ExtUtils-Manifest
Warning:prerequisite Test::More 0 not found
解決方法:
Can'tlocate ExtUtils/Manifest.pm in @INC
解決方法:yum install perl-core
本文轉自812374156 51CTO部落格,原文連結:http://blog.51cto.com/xiong51/1945233,如需轉載請自行聯系原作者