本次环境centos7,此外一定要做好时间同步,并且关闭防火墙以及selinux,不然安装可能会失败。
用的软件包!下载地址
http://note.youdao.com/yws/public/resource/2fec300a7dc19549760a882942de5b69/xmlnote/F379E4035DF147D9A8888E82F954DBB5/470
http://note.youdao.com/yws/public/resource/2fec300a7dc19549760a882942de5b69/xmlnote/F1CD121DBCCB4C7B892DF2FCC5AC82FB/477
每个也不大就几百k
时间同步方式如下:
#yum install ntpdate -y
#ntpdate times.aliyun.com
1、安装成吨的依赖包,有兴趣的可以编译安装
#yum groupinstall "Compatibility libraries" "Base" "Development tools" -y #很多同学在装系统的时候选择包有问题,因此安装这些保证环境一致性
#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 perl-CGI-SpeedyCGI perl-Sys-Syslog popt-devel libidn-devel fping
解压、编译安装fping
把包放在一个目录下进行解压编译安装fping
tar zxf fping-3.10.tar.gz
cd fping-3.10
./configure
make && make install
2、安装smokeping-2.6.8.tar.gz
wget http://pkgs.fedoraproject.org/repo/pkgs/smokeping/smokeping-2.6.8.tar.gz/md5/14a968daab2d17a27d41600077e3e967/smokeping-2.6.8.tar.gz
#tar xvf smokeping-2.6.8.tar.gz
#cd smokeping-2.6.8
#./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
#./configure --prefix=/usr/local/smokeping
# /usr/bin/gmake install
# /usr/bin/gmake install #重要的安装来两遍
3.配置修改
#cd /usr/local/smokeping/
#mkdir cache data var
#touch /var/log/smokeping.log
#chown apache:apache cache data var
#chown apache:apache /var/log/smokeping.log
#chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
#cd /usr/local/smokeping/htdocs
#mv smokeping.fcgi.dist smokeping.fcgi
#cd /usr/local/smokeping/etc
#mv config.dist config
4.apache配置修改
修改主配置文件
vim /etc/httpd/conf/httpd.conf
< Directory "/var/www/html"> 修改为:
< Directory "/usr/local/smokeping">
增加somekping配置
#vim /etc/httpd/conf.d/somekping.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>
#systemctl restart httpd
重启apache,至此smokeping搭建完毕,不过现在还不能正常使用,因此我们需要进行配置
vim /usr/local/smokeping/etc/config
修改为:
cgiurl = http://192.168.141.129/smokeping.cgi
#注意192.168.141.129为本机IP请根据实际情况进行修改
step = 300修改为:
step = 60
pings = 20 修改为:
pings = 10
#修改binary = /usr/sbin/fping 在108行左右
为binary = /usr/local/sbin/fping
#修改频率把Test和MultiHost注释
#在最后添加如下数据并保存
+ Other
menu = 三大网络监控
title = 监控统计
++ dianxin
menu = 电信网络监控
title = 电信网络监控列表
+++ dianxin-bj
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133
+++ dianxin-hlj
menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242
+++ dianxin-tj
menu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132
+++ dianxin-sc
menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69
+++ dianxin-sh
menu = 上海电信
title = 上海电信
alerts = someloss
host = 116.228.111.118
+++ dianxin-gz
menu = 广东电信
title = 广东电信
alerts = someloss
host = 113.111.211.22
++ liantong
menu = 联通网络监控
title = 联通网络监控列表
+++ liantong-bj
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121
+++ liantong-hlj
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69
+++ liantong-tj
menu = 天津联通
title = 天津联通
alerts = someloss
host = 202.99.96.68
+++ liantong-sc
menu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6
+++ liantong-sh
menu = 上海联通
title = 上海联通
alerts = someloss
host = 210.22.84.3
+++ liantong-gz
menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88
++ yidong
menu = 移动网络监控
title = 移动网络监控列表
+++ yidong-bj
menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52
+++ yidong-hlj
menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35
+++ yidong-tj
menu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5
+++ yidong-sc
menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3
+++ yidong-sh
menu = 上海移动
title = 上海移动
alerts = someloss
host = 117.131.19.23
+++ yidong-gz
menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6
*** Presentation ***
charset = utf-8
#在Presentation 下添加charset = utf-8然后保存退出
yum -y install wqy-zenhei-fonts #安装字体包
vim /usr/local/smokeping//lib/Smokeping/Graphs.pm
my $val = 0;
for my $host (@hosts){
my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
'--font TITLE:20""', #增加这一行
"DEF:maxping=$cfg->{General{datadir}${host}.rrd:median:AVERAGE",
'PRINT:maxping:MAX:%le' );
my $ERROR = RRDs::error();