cheng029 发表于 2012-6-19 20:56:01

smokeping安装配置

Smokeping 安装配置
一、介绍
smokeping是rrdtool的作者Tobi Oetiker的作品,所以它在图形显示方面有很大优势,也是一个很有特点的opensource工具:多种探测方式,包括fping、echoping、dig、curl等;
易用可扩展的插件;
master/slave的工作方式,可以在多个节点收集同一个监测点的数据;很有特色的alert设置,不只是简单的设置一个阀值;二、安装在装好LAMP与PERL基础上,再安装以下软件所需软件wget http://dag.wieers.com/rpm/packages/fping/fping-2.4-1.b2.2.el5.rf.x86_64.rpmwget http://www.bjlx.org.cn/debian/pool/main/e/echoping/echoping_5.2.0.orig.tar.gzwget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gzwget http://daemoninc.com/SpeedyCGI/CGI-SpeedyCGI-2.22.tar.gzwget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.tar.gz安装fping-2.4-1.b2.2.el5.rf.x86_64.rpmRpm ?ivh fping-2.4-1.b2.2.el5.rf.x86_64.rpm安装CGI-SpeedyCGI-2.22.tar.gzTar ?zxvf CGI-SpeedyCGI-2.22.tar.gzcd CGI-SpeedyCGI-2.22perl Makefile.PLCompile mod_speedycgi (default no)? noMake && make install安装echoping_5.2.0.orig.tar.gzTar zxvf echoping_5.2.0.orig.tar.gzcd echoping_5.2.0./configure --prefix=/usr/local/echoping --with-ssl --without-libidn Make && make install安装rrdtool-1.4.2.tar.gz Tar zxvf rrdtool-1.4.2.tar.gzCd rrdtool-1.4.2./configure
--prefix=/usr/local/rrdtoolMake && make install安装:smokeping-2.4.2.tar.gzTar zxvf smokeping-2.4.2.tar.gzmv smokeping-2.4.2 /usr/local/smokeping二、修改相关配置文件Mkdir ?p /usr/local/smokeping/cacheMkdir ?p /usr/local/smokeping/var1、/usr/local/smokeping/etc/ config.dist
如下:
[*]*** General ***
[*]
[*]owner = apache
[*]contact = tomlinx@linuxtone.org
[*]mailhost = localhost
[*]sendmail = /usr/local/bin/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/var
[*]piddir = /usr/local/smokeping/var
[*]cgiurl = http://some.url/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 = |/usr/local/smokeping/fx.sh
[*]to = tomlinux@linuxtone.org
[*]from = abc@xy.com
[*]定义丢包率;
[*]+someloss
[*]type = loss
[*]# in percent
[*]pattern = >0%,*12*,>0%,*12*,>0%
[*]comment = loss 3 times in a row
[*](检测12次,出现了3次丢包的情况,不论丢多少个包,就进行alter)
[*]+rttbad
[*]type = rtt
[*]pattern = ==S,>50,>50
[*]comment = route
[*](如果连续出现两次50ms 以上的延时,就进行alter)
[*]*** Database ***
[*](每300秒ping 20次)
[*]
[*]step = 300
[*]pings = 20
[*]
[*]# 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 PING使用的工具
[*]
[*]#*** Slaves ***
[*]#secrets=/home/oetiker/checkouts/smokeping/trunk/software/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.
[*]
[*]+ Test 定义一级目录
[*]menu= test
[*]tile = test
[*]#parents = owner:/Test/James location:/
[*]
[*]++ host1 添加主机
[*]title = host1
[*]alerts = someloss,rttbad
[*]host = 192.168.11.111
[*]
[*]+ nagios
[*]menu = nagios
[*]++ nagios
[*]title = nagios
[*]alerts = someloss
[*]host = 192.168.11.105

复制代码

2、/usr/local/smokeping/htdocs/smokeping.cgi修改Cp /usr/local/smokeping/htdocs/smokeping.cgi.dist usr/local/smokeping/htdocs/smokeping.cgiuse lib qw(/usr/local/rrdtool/lib/perl);use lib qw(/usr/local/smokeping/lib);Smokeping::cgi("/usr/local/smokeping/etc/config.dist");3、/usr/local/smokeping/bin/smokeping.dist 修改use lib qw(/usr/local/rrdtool/lib/perl);use lib qw(/usr/local/smokeping/lib);4、启动/usr/local/smokeping/bin/smokeping.dist startChown apache.apache /usr/local/smokeping ?R三、配置httpd.conf如下:Alias /smokeping/ "/usr/local/smokeping/"<Directory "/usr/local/smokeping/ ">
AllowOverride None
AddHandler cgi-script cgi
Options ExecCGI

Order allow,deny
Allow from all</Directory>启动脚本:http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script访问:http://ip/smokeping/htdocs/smokeping.cgi

ykwll 发表于 2013-3-13 16:21:55

好好 学习了 确实不错

jason0401 发表于 2013-5-15 18:07:49

吃饭与ml是第一生产力。

olga 发表于 2013-5-15 21:30:57

有竞争才有进步嘛

noel0217 发表于 2013-5-15 23:36:32

天塌下来你顶着,我垫着!

shilang 发表于 2013-5-16 03:55:43

长大了娶唐僧做老公,能玩就玩一玩,不能玩就把他吃掉。

dog1888 发表于 2013-5-16 07:17:20

如果恐龙是人,那人是什么?
页: [1]
查看完整版本: smokeping安装配置