smokeping在centos7.3上安装部署
前期准备工作
smokeping软件包下载地址
http://oss.oetiker.ch/smokeping/pub/
实验机器环境
[root@data-1-1 ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [root@data-1-1 ~]# uname -rm 3.10.0-514.el7.x86_64 x86_64 [root@data-1-1 ~]#
系统环境安装一些基础工具包,可以参照http://www.cnblogs.com/nmap/p/6368157.html
安装前的准备
做好时间同步,并且关闭防火墙以及selinux
时间同步方式如下:
[root@data-1-1 ~]# date 2017年 03月 07日 星期二 17:40:01 CST [root@data-1-1 ~]# ntpdate times.aliyun.com 7 Mar 09:41:20 ntpdate[5253]: step time server 120.25.115.19 offset -28729.847686 sec [root@data-1-1 ~]# date 2017年 03月 07日 星期二 09:41:27 CST [root@data-1-1 ~]#
安装成吨的依赖包,有兴趣的可以编译安装
很多同学在装系统的时候选择包有问题,因此安装这些保证环境一致性
安装开发依赖包
[root@data-1-1 ~]# yum groupinstall "Compatibility libraries" "Base" "Development tools" -y 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.aliyun.com * updates: mirrors.163.com Maybe run: yum groups mark install (see man yum) 指定组中没有可安装或升级的软件包 [root@data-1-1 ~]#
安装smokeping依赖需要的包,smokeping服务运行需要apache展示,所以就安装了httpd相关的包
[root@data-1-1 ~]# 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 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.aliyun.com * updates: mirrors.163.com 软件包 4:perl-5.16.3-291.el7.x86_64 已安装并且是最新版本 软件包 perl-Net-Telnet-3.03-19.el7.noarch 已安装并且是最新版本 软件包 perl-Net-DNS-0.72-6.el7.x86_64 已安装并且是最新版本 软件包 1:perl-LDAP-0.56-5.el7.noarch 已安装并且是最新版本 软件包 perl-libwww-perl-6.05-2.el7.noarch 已安装并且是最新版本 软件包 perl-IO-Socket-SSL-1.94-5.el7.noarch 已安装并且是最新版本 软件包 perl-Socket6-0.23-15.el7.x86_64 已安装并且是最新版本 软件包 4:perl-Time-HiRes-1.9725-3.el7.x86_64 已安装并且是最新版本 软件包 perl-ExtUtils-MakeMaker-6.68-3.el7.noarch 已安装并且是最新版本 软件包 rrdtool-1.4.8-9.el7.x86_64 已安装并且是最新版本 软件包 rrdtool-perl-1.4.8-9.el7.x86_64 已安装并且是最新版本 软件包 curl-7.29.0-35.el7.centos.x86_64 已安装并且是最新版本 软件包 httpd-2.4.6-45.el7.centos.x86_64 已安装并且是最新版本 软件包 httpd-devel-2.4.6-45.el7.centos.x86_64 已安装并且是最新版本 软件包 gcc-4.8.5-11.el7.x86_64 已安装并且是最新版本 软件包 1:make-3.82-23.el7.x86_64 已安装并且是最新版本 软件包 wget-1.14-13.el7.x86_64 已安装并且是最新版本 软件包 libxml2-devel-2.9.1-6.el7_2.3.x86_64 已安装并且是最新版本 软件包 2:libpng-devel-1.5.13-7.el7_2.x86_64 已安装并且是最新版本 没有可用软件包 glib。 软件包 pango-1.36.8-2.el7.x86_64 已安装并且是最新版本 软件包 pango-devel-1.36.8-2.el7.x86_64 已安装并且是最新版本 软件包 freetype-2.4.11-12.el7.x86_64 已安装并且是最新版本 软件包 freetype-devel-2.4.11-12.el7.x86_64 已安装并且是最新版本 软件包 fontconfig-2.10.95-10.el7.x86_64 已安装并且是最新版本 软件包 cairo-1.14.2-1.el7.x86_64 已安装并且是最新版本 软件包 cairo-devel-1.14.2-1.el7.x86_64 已安装并且是最新版本 软件包 libart_lgpl-2.3.21-10.el7.x86_64 已安装并且是最新版本 软件包 libart_lgpl-devel-2.3.21-10.el7.x86_64 已安装并且是最新版本 没有可用软件包 perl-CGI-SpeedyCGI。 软件包 perl-Sys-Syslog-0.33-3.el7.x86_64 已安装并且是最新版本 软件包 popt-devel-1.13-16.el7.x86_64 已安装并且是最新版本 软件包 libidn-devel-1.28-4.el7.x86_64 已安装并且是最新版本 没有可用软件包 fping。 无须任何处理 [root@data-1-1 ~]#
缺少一些工具包,安装epel源,这里由于是centos7的,选择centos7
[root@data-1-1 ~]# rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm 获取https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm 警告:/var/tmp/rpm-tmp.CK9rIg: 头V3 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:epel-release-7-9 ################################# [100%] [root@data-1-1 ~]#
[root@data-1-1 ~]# tail -1 /etc/profile export LANG=en_US.UTF-8 [root@data-1-1 ~]# source /etc/profile [root@data-1-1 ~]#
[root@data-1-1 ~]# 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 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * epel: mirror.premi.st * extras: mirrors.aliyun.com * updates: mirrors.163.com Package 4:perl-5.16.3-291.el7.x86_64 already installed and latest version Package perl-Net-Telnet-3.03-19.el7.noarch already installed and latest version Package perl-Net-DNS-0.72-6.el7.x86_64 already installed and latest version Package 1:perl-LDAP-0.56-5.el7.noarch already installed and latest version Package perl-libwww-perl-6.05-2.el7.noarch already installed and latest version Package perl-IO-Socket-SSL-1.94-5.el7.noarch already installed and latest version Package perl-Socket6-0.23-15.el7.x86_64 already installed and latest version Package 4:perl-Time-HiRes-1.9725-3.el7.x86_64 already installed and latest version Package perl-ExtUtils-MakeMaker-6.68-3.el7.noarch already installed and latest version Package rrdtool-1.4.8-9.el7.x86_64 already installed and latest version Package rrdtool-perl-1.4.8-9.el7.x86_64 already installed and latest version Package curl-7.29.0-35.el7.centos.x86_64 already installed and latest version Package httpd-2.4.6-45.el7.centos.x86_64 already installed and latest version Package httpd-devel-2.4.6-45.el7.centos.x86_64 already installed and latest version Package gcc-4.8.5-11.el7.x86_64 already installed and latest version Package 1:make-3.82-23.el7.x86_64 already installed and latest version Package wget-1.14-13.el7.x86_64 already installed and latest version Package libxml2-devel-2.9.1-6.el7_2.3.x86_64 already installed and latest version Package 2:libpng-devel-1.5.13-7.el7_2.x86_64 already installed and latest version Package 1:glib-1.2.10-41.el7.x86_64 already installed and latest version Package pango-1.36.8-2.el7.x86_64 already installed and latest version Package pango-devel-1.36.8-2.el7.x86_64 already installed and latest version Package freetype-2.4.11-12.el7.x86_64 already installed and latest version Package freetype-devel-2.4.11-12.el7.x86_64 already installed and latest version Package fontconfig-2.10.95-10.el7.x86_64 already installed and latest version Package cairo-1.14.2-1.el7.x86_64 already installed and latest version Package cairo-devel-1.14.2-1.el7.x86_64 already installed and latest version Package libart_lgpl-2.3.21-10.el7.x86_64 already installed and latest version Package libart_lgpl-devel-2.3.21-10.el7.x86_64 already installed and latest version Package perl-CGI-SpeedyCGI-2.22-16.el7.1.x86_64 already installed and latest version Package perl-Sys-Syslog-0.33-3.el7.x86_64 already installed and latest version Package popt-devel-1.13-16.el7.x86_64 already installed and latest version Package libidn-devel-1.28-4.el7.x86_64 already installed and latest version Package fping-3.10-4.el7.x86_64 already installed and latest version Nothing to do [root@data-1-1 ~]#
smokeping安装和配置
安装smokeping-2.6.8.tar.gz
执行命令如下
wget http://oss.oetiker.ch/smokeping/pub/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 #重要的安装来两遍
注意软件包的md5值为下面。注意和我的对比下
[root@data-1-1 tools]# md5sum smokeping-2.6.8.tar.gz 14a968daab2d17a27d41600077e3e967 smokeping-2.6.8.tar.gz [root@data-1-1 tools]#
上面操作最后的gmake, gmake执行两遍才成功,gmake第一遍执行报错了
[root@data-1-1 smokeping-2.6.8]# /usr/bin/gmake install Making install in bin gmake[1]: Entering directory `/tools/smokeping-2.6.8/bin' gmake[2]: Entering directory `/tools/smokeping-2.6.8/bin' test -z "/usr/local/smokeping/bin" || /usr/bin/mkdir -p "/usr/local/smokeping/bin" /usr/bin/install -c smokeinfo smokeping smokeping_cgi tSmoke '/usr/local/smokeping/bin' /usr/bin/gmake install-exec-hook gmake[3]: Entering directory `/tools/smokeping-2.6.8/bin' [ xERL5LIB != x ] && cd "/usr/local/smokeping/bin" && /usr/bin/perl -i -p -e 's{^#!.*}{#!/usr/bin/perl}; s{.*# PERL5LIB}{use lib qw(); # PERL5LIB}' smokeinfo smokeping_config.pod around line 81: alternative text 'the master/slave mode' contains non-escaped | or / POD document had syntax errors at /usr/bin/pod2man line 69. gmake[1]: *** [smokeping_config.5] Error 255 rm Smokeping_probes_IOSPing.pod Smokeping_probes_EchoPing.pod Smokeping_probes_Radius.pod Smokeping_probes_SipSak.pod Smokeping_probes_EchoPingPlugin.pod Smokeping_probes_FPing6.pod Smokeping_probes_EchoPingIcp.pod Smokeping_probes_Curl.pod Smokeping_probes_CiscoRTTMonDNS.pod Smokeping_probes_EchoPingDNS.pod Smokeping_probes_SSH.pod Smokeping_probes_DismanPing.pod Smokeping_probes_WebProxyFilter.pod Smokeping_probes_RemoteFPing.pod Smokeping_probes_OpenSSHJunOSPing.pod Smokeping_probes_EchoPingLDAP.pod Smokeping_probes_LDAP.pod Smokeping_probes_TacacsPlus.pod Smokeping_probes_TelnetIOSPing.pod Smokeping_probes_NFSping.pod Smokeping_probes_basefork.pod Smokeping_probes_EchoPingChargen.pod Smokeping_probes_basevars.pod Smokeping_probes_EchoPingSmtp.pod Smokeping_probes_FPing.pod Smokeping_probes_FTPtransfer.pod Smokeping_probes_EchoPingHttps.pod Smokeping_probes_EchoPingDiscard.pod Smokeping_probes_AnotherSSH.pod Smokeping_probes_CiscoRTTMonEchoICMP.pod Smokeping_probes_passwordchecker.pod Smokeping_probes_base.pod Smokeping_probes_TelnetJunOSPing.pod Smokeping_probes_EchoPingHttp.pod Smokeping_probes_AnotherDNS.pod Smokeping_probes_TCPPing.pod Smokeping_probes_EchoPingWhois.pod Smokeping_probes_skel.pod Smokeping_probes_DNS.pod Smokeping_probes_CiscoRTTMonTcpConnect.pod gmake[1]: Leaving directory `/tools/smokeping-2.6.8/doc' gmake: *** [install-recursive] Error 1 第二遍执行成 [root@data-1-1 smokeping-2.6.8]# /usr/bin/gmake install Making install in bin gmake[2]: Nothing to be done for `install-exec-am'. test -z "/usr/local/smokeping/lib" || /usr/bin/mkdir -p "/usr/local/smokeping/lib" gmake[1]: Leaving directory `/tools/smokeping-2.6.8/lib' gmake[1]: Entering directory `/tools/smokeping-2.6.8' gmake[2]: Entering directory `/tools/smokeping-2.6.8' gmake[2]: Nothing to be done for `install-exec-am'. gmake[2]: Nothing to be done for `install-data-am'. gmake[2]: Leaving directory `/tools/smokeping-2.6.8' gmake[1]: Leaving directory `/tools/smokeping-2.6.8' [root@data-1-1 smokeping-2.6.8]# echo $? 0 [root@data-1-1 smokeping-2.6.8]#
smokeping基础配置修改
命令如下
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
[root@data-1-1 smokeping-2.6.8]# cd /usr/local/smokeping/ [root@data-1-1 smokeping]# ls bin etc htdocs lib share thirdparty [root@data-1-1 smokeping]# mkdir cache data var [root@data-1-1 smokeping]# touch /var/log/smokeping.log [root@data-1-1 smokeping]# chown apache:apache cache data var [root@data-1-1 smokeping]# chown apache:apache /var/log/smokeping.log [root@data-1-1 smokeping]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist [root@data-1-1 smokeping]# cd /usr/local/smokeping/htdocs [root@data-1-1 htdocs]# mv smokeping.fcgi.dist smokeping.fcgi [root@data-1-1 htdocs]# cd /usr/local/smokeping/etc [root@data-1-1 etc]# mv config.dist config [root@data-1-1 etc]#
apache配置修改
修改主配置文件
修改主配置文件
vim /etc/httpd/conf/httpd.conf
<Directory "/var/www/html"> 改成 <Directory "/usr/local/smokeping">
改成如下
增加somekping配置,新建一个smokeping.conf文件
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>
检查下
[root@data-1-1 etc]# cat /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> [root@data-1-1 etc]#
重启apache服务
[root@data-1-1 etc]# systemctl restart httpd [root@data-1-1 etc]# lsof -i:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME httpd 24029 root 4u IPv6 113762 0t0 TCP *:http (LISTEN) httpd 24030 apache 4u IPv6 113762 0t0 TCP *:http (LISTEN) httpd 24031 apache 4u IPv6 113762 0t0 TCP *:http (LISTEN) httpd 24032 apache 4u IPv6 113762 0t0 TCP *:http (LISTEN) httpd 24033 apache 4u IPv6 113762 0t0 TCP *:http (LISTEN) httpd 24034 apache 4u IPv6 113762 0t0 TCP *:http (LISTEN) [root@data-1-1 etc]#
至此smokeping搭建完毕,不过现在还不能正常使用,因此我们需要进行配置
ping监控配置
修改smokeping配置文件
vim /usr/local/smokeping/etc/config
修改如下内容
把cgiurl = http://some.url/smokeping.cgi 改成 cgiurl = http://10.0.1.73/smokeping.cgi #注意10.0.1.73为本机IP请根据实际情况进行修改
原来是如下默认的配置
修改监控频率,ping目标的频率等
原先是如下内容
改成如下内容
删除默认的test数据,一下红框里的需要删除,在文件的末尾部分
添加如下数据并保存,以下IP地址都是各个地区的DNS服务器。有些DNS服务器做了限制无法ping通,需要替换为可以ping通的
+ 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 有个问题需要我们注意+是第一层,++是第二层,+++ 是第三层,添加监控节点一定要按照此规范哦
[root@data-1-1 etc]# cat /usr/local/smokeping/etc/config *** General *** owner = Peter Random contact = some@address.nowhere 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 = /usr/local/smokeping/cache imgurl = cache datadir = /usr/local/smokeping/data piddir = /usr/local/smokeping/var cgiurl = http://10.0.1.73/smokeping.cgi smokemail = /usr/local/smokeping/etc/smokemail.dist tmail = /usr/local/smokeping/etc/tmail.dist # 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 = alertee@address.somewhere from = smokealert@company.xy +someloss type = loss # in percent pattern = >0%,*12*,>0%,*12*,>0% comment = loss 3 times in a row *** Database *** step = 60 pings = 10 # 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 = /usr/local/smokeping/etc/basepage.html.dist + 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 width = 600 height = 200 unison_tolerance = 2 "Last 3 Hours" 3h "Last 30 Hours" 30h "Last 10 Days" 10d "Last 400 Days" 400d #+ hierarchies #++ owner #title = Host Owner #++ location #title = Location *** Probes *** + FPing binary = /usr/sbin/fping *** Slaves *** secrets=/usr/local/smokeping/etc/smokeping_secrets.dist +boomer display_name=boomer color=0000ff +slave2 display_name=another color=00ff00 *** 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. + 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 [root@data-1-1 etc]#
[root@data-1-1 etc]# /usr/local/smokeping/bin/smokeping Note: logging to syslog as local0/info. Daemonizing /usr/local/smokeping/bin/smokeping ... [root@data-1-1 etc]# ps aux | grep smoke root 24096 0.0 0.5 300356 23900 ? Ss 10:35 0:00 /usr/local/smokeping/binsmokeping [FPing] root 24098 0.0 0.0 112648 960 pts/0 S+ 10:35 0:00 grep --colour=auto smoke [root@data-1-1 etc]#
显示乱码问题解决
需要修改配置文件里,指定字符集才能正确显示
vim /usr/local/smokeping/etc/config
安装字体包
[root@data-1-1 etc]# yum -y install wqy-zenhei-fonts Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.163.com Package wqy-zenhei-fonts-0.9.46-11.el7.noarch already installed and latest version Nothing to do [root@data-1-1 etc]#
修改 Graphs.pm
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm 在148行附近 增加这一行,注意不要缺少标点符号 '--font TITLE:20""',
此版本的smokeping还有一定问题,无法重启和重载
[root@data-1-1 etc]# /usr/local/smokeping/bin/smokeping restart Note: logging to syslog as local0/info. ERROR: I Quit! Another copy of /usr/local/smokeping/bin/smokeping (24096) seems to be running. Check /usr/local/smokeping/var/smokeping.pid [root@data-1-1 etc]# ps aux | grep smok root 24096 0.0 0.6 313224 25284 ? Ss 10:35 0:00 /usr/local/smokeping/binsmokeping [FPing] root 24337 0.0 0.0 112648 960 pts/0 S+ 10:42 0:00 grep --colour=auto smok [root@data-1-1 etc]# /usr/local/smokeping/bin/smokeping reload Note: logging to syslog as local0/info. ERROR: I Quit! Another copy of /usr/local/smokeping/bin/smokeping (24096) seems to be running. Check /usr/local/smokeping/var/smokeping.pid [root@data-1-1 etc]#
[root@data-1-1 etc]# ps aux | grep smok root 24096 0.0 0.6 313224 25284 ? Ss 10:35 0:00 /usr/local/smokeping/bin/smokeping [FPing] root 24360 0.0 0.0 112648 956 pts/0 S+ 10:43 0:00 grep --colour=auto smok [root@data-1-1 etc]# kill -9 24096 [root@data-1-1 etc]# ps aux | grep smok root 24364 0.0 0.0 112648 956 pts/0 S+ 10:43 0:00 grep --colour=auto smok [root@data-1-1 etc]# /usr/local/smokeping/bin/smokeping Note: logging to syslog as local0/info. Daemonizing /usr/local/smokeping/bin/smokeping ... [root@data-1-1 etc]# ps aux | grep smok root 24369 0.0 0.5 300356 23948 ? Ss 10:43 0:00 /usr/local/smokeping/bin/smokeping [FPing] root 24371 0.0 0.0 112648 960 pts/0 S+ 10:43 0:00 grep --colour=auto smok [root@data-1-1 etc]#
实验参照链接
http://www.aclstack.com/454.html
2.6.11版本的可以参照下面链接,这里我没测试
http://ggvylf.blog.51cto.com/784661/1790207