Linux下构建Smokeping网络监控平台(5)

四. Smokeping 的其它配置
4.1 监控节点的增加
[root@smokeping ~]# vim /usr/local/smokeping/etc/config
+ xjzhujunjie
menu = xjzhujunjie
title = xjzhujunjie-server
################web server###############
++ junjie-web
menu = junjie-web
title = xjzhujunjie 网站 192.168.101.82
host = 192.168.101.82
[root@smokeping ~]# service smokeping stop
/etc/init.d/smokeping: line 14: gt: command not found
/etc/init.d/smokeping: line 14: /dev/null: Permission denied
/etc/init.d/smokeping stop: smokeping not running
[root@smokeping ~]# service smokeping start
WARNING: Hostname 'james.address' does currently not resolve to an IPv6 or IPv4 address
/etc/init.d/smokeping start: smokeping started

Linux下构建Smokeping网络监控平台


Linux下构建Smokeping网络监控平台


4.2 报警设置
smokeping的alert设置有点复杂,但是却很好用,设置很灵活,考虑得很周全。它可以使用邮件进行alert,也可以直接调用外部程序进行IM的报警。在我们的监控中主要是采用邮件报警。报警参数设置如下,哪个节点需要报警增加alerts = manyloss即可
[root@smokeping ~]# vim /usr/local/smokeping/etc/config
*** Alerts ***
to = xjzhujunjie@
from = xjzhujunjie@
+someloss
type = loss
pattern = >0%,*30*,>0%,*30*,>0% # in percent
comment = loss 1 packages in 30 continuous 3 times.
+manyloss
type = loss
pattern = >15%,*30*,>15%,*30*,>15% # in percent
comment = loss 5 packages in 30 continuous 3 times.
+rttbad
type = rtt
pattern = ==S,>50,>50 # in milliseconds
comment = For more than two consecutive 50-millisecond delay.
[root@smokeping ~]# service smokeping stop
/etc/init.d/smokeping: line 14: gt: command not found
/etc/init.d/smokeping: line 14: /dev/null: Permission denied
/etc/init.d/smokeping stop: smokeping not running
[root@smokeping ~]# service smokeping start
WARNING: Hostname 'james.address' does currently not resolve to an IPv6 or IPv4 address
/etc/init.d/smokeping start: smokeping started
(1)to 表示接受所有报警的邮箱,如果需要在特定的节点报警发送到特定的邮箱则在该节点上增加alertee = xjzhujunjie@ 即可。
(2)manyloss 表示30个包丢15%的情况 连续出现3次就发报警。
(3)someloss 表示30个包丢1个,连续出现3次就发送报警;rttbad表示连续两个包延迟超过50ms就发送报警。
4.3 画图设置
Smokeping默认设置中是每5分钟画一次图,每5分钟发送20个ping包。网络工程师认为5分钟发送20个ping包太少,建议改为5分钟100个。画图的颜色等也要进行相应的更改: 在Database中,step =300 pings =20 改为 step = 300 pings =100

Linux下构建Smokeping网络监控平台


从图上可以看到,slave主机会自己去检查监测点的情况(loss and rtt),并将数值提交给master主机(通过smokeping.cgi)。值得注意的是,slave并不需要config文件,每次slave提交完数据以后,会询问master它自己的配置文件是否有修改,如果有修改的话slave会进行更新。
其它关于smokeping的使用,待续…….

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3e723762f05304a6467df38a3d64aa45.html