1 什么是smokeping 2 smokeping架构组成 3 smokeping分布式介绍 4 如何看懂smokeping图表 5 如何判断一个节点的好坏
Smokeping是rrdtool的作者TobiOetiker 的作品,是用Perl 写的,主要是监视网络性能,包括常规的ping,用echoping 监www 服务器性能,监视dns 查询性能,监视ssh 性能等。底层也是rrdtool做支持,特点是画的图非常漂亮,网络丢包和延迟用颜色和阴影来表示。 Smokeping由以下组件组成: RRDtool、Fping、Echoping、Curl、Dig、SSh、Perl 模块, Perl、SpeedyCGI、ApacheORNGINX
使用Smokeping的过程中,很容易就发现,如果从单个节点去探测网络性能,往往是不够的,Smokeping提供了多节点的分布式部署功能,也就是可以从多个节点去探测到某个地区的网络状态,这样才是我们监控网络希望看到的情况。 Smokeping称其为主从模式,主从模式的配置很简单,从服务器的安装和主服务器相同,只是从服务器不用自己的config文件,而是在启动的过程中请求主服务器的config文件,这样你只需要维护主服务器上的配置文件即可。 Smokeping检测分布式的检测方式是被动模式,由从节点启动时获得主节点的config文件,然后进行测试,测试完毕后直接将数据提交给主节点。主从通信验证是通过我们可以设置多个从服务器,主从服务器通过指定--shared-secret=filename来和主进行密码验证。
X轴表示时间轴 Y轴表示ping的时间值 3.6ms表示 Ping质量测试的响应速度平均值
中间红线能看出网络是否有抖动 直线表示稳定,有频繁曲线表示网络抖动;如果是阴影表示有网络小幅度抖动 ls字段表示Ping质量测试的丢包率
根据网络抖动判断,抖动范围超过10ms的都属于网络不稳定我们要每天观察是否都有规律的网络抖动现象
根据丢包状况判断: 刚进入详细报告后,看总曲线的颜色,根据20个测试数据包返回的数据判断 绿色表示0丢包.属于最好.浅蓝色1个丢包,深蓝色2个丢包….以此类推
从这个报告图里可以看出: 1.曲线都是绿色的0丢包 或偶尔一两个丢包算合格 2.曲线无抖动,阴影不明显 或偶尔有抖动的算合格 (包裹阴影部分) 3.Ping值小于30ms 如果小于50ms还算合格
smokeping搭建 可分多种web框架可选nginx apache等 接口可选fsgi cgi
1服务端安装 apache安装略
httpd.conf中directory字段加入 </Directory>
<Directory "/usr/local/smokeping/htdocs">
#Options FollowSymLinks ExecCGI
Options Indexes FollowSymLinks
Options ExecCGI
#AllowOverride None
#Order allow,deny
#Allow from all
</Directory> Alias /smokeping "/usr/local/smokeping/"
<Directory /usr/local/smokeping/>
AllowOverride None
AddHandler cgi-script cgi
Options ExecCGI
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
DirectoryIndex smokeping.cgi
</Directory>
1).rrdtool.FPing.EchoPing.Curl.dig.SSH
wget http://sourceforge.net/projects/ ... 0.2.tar.gz/download
wget http://fping.sourceforge.net/download/fping.tar.gz
wget http://dag.wieers.com/rpm/packag ... 2.el5.rf.x86_64.rpm
wget http://dag.wieers.com/rpm/packag ... 2.el5.rf.x86_64.rpm
rpm -ivh *ping*x86_64.rpm
yum install -y freetype freetype-devel libpng libpng-devel gd gd-devel pango pango-devel libxml2 libxml2-devel libart_lgpl libart_lgpl-devel perl-libwww-perl perl-IO-Socket-SSL perl-Net-Telnet perl-Socket6 perl-Net-DNS perl-LDAP
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
tar zvxf rrdtool-1.4.5.tar.gz && cd rrdtool-1.4.5
sed -i 's/setlocale(LC_NUMERIC, "C")/setlocale(LC_NUMERIC, "zh_CN.UTF-8")/g' src/rrd_graph.c
./configure --prefix=/usr/local/rrdtool --enable-perl-site-install --with-perl-options &&make &&make install
perl -MRRDs -le 'print q(ok!)' 查看RRDs.pm 提示加载libdbi.so.o加载不上,安装yum install libdbi
2).perl(Perl 5.8.8)的模块支持
#perl -MCPAN -e -shell
#install FCGI,CGI,CGI::Fast,Config::Grammar,Digest::HMAC_MD5,Net::Telnet,Net::OpenSSH,Net::SNMP,Net::LDAP,Net::DNS, IO::Pty,LWP,Socket6,IO::Socket::SSL
perl -MCPAN -e 'install FCGI,CGI,CGI::Fast,Config::Grammar,Digest::HMAC_MD5,Net::Telnet,Net::OpenSSH,Net::SNMP,Net::LDAP,Net::DNS, IO::Pty,LWP,Socket6,IO::Socket::SSL'
3).smokeping安装
export PERL5LIB=/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/ #64位系统
export PERL5LIB=/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/ #32位系统
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.6.tar.gz
tar zvxf smokeping-2.6.6.tar.gz && cd smokeping-2.6.6
./configure --prefix=/usr/local/smokeping &&make &&make install
########################分割线############################################### smokeping config中需要配置的项和优化 *** General ***
owner = www.funshion.com
contact = wanghd@funshion.com
mailhost = mail.funshion.com
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 = http://192.168.x.x/smokeping/cache
datadir = /usr/local/smokeping/data
piddir = /usr/local/smokeping/var
cgiurl = http://192.168.x.x/smokeping/htdocs/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail
tmail = /usr/local/smokeping/etc/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 = yes
*** Alerts ***
to = zhoumenglong@163.com
from = zhoumenglong@163.com
+someloss
type = loss
# in percent
pattern = >3%,*12*,>3%,*12*,>3%
comment = detected loss 3 times over the last two hours
+highloss
type = loss
# in percent
pattern = >50%,*12*,>50%,*12*,>50%
comment = detected loss 3 times over the last two hours
+rttdetect
type = rtt
# in milliseconds
pattern = <100,<100,<100,<100,<100,>100,>100,>100,>100
comment = routing messed up again ?
+highrttdetect
type = rtt
# in milliseconds
pattern = <20,<20,<20,<20,<20,>20,>20,>20,>20
comment = routing messed up again ?
*** Database ***
step = 300
pings = 100
# 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
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 = 100
range = 12h
+ detail
width = 600
height = 200
#loss_background = yes
unison_tolerance = 2
"最后1天" 1d
"最后1周" 7d
"最后1个月" 30d
++loss_colors
0 00ff00 "0"
1 00b8ff "1/100"
2 0059ff "2/100"
3 5e00ff "3/100"
4 7e00ef "4/100"
5 ffff00 "5/100"
10 ff00ff "10/100"
50 ff0000 "50/100"
#99 ff0000 "99/100"
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/sbin/fping
*** Slaves ***
secrets=/usr/local/smokeping/etc/secrets
+zhengzhoucnc
display_name=郑州联通
color=b0e0e6
*** Targets ***
probe = FPing
menu = Top
title = www.funshion.com
remark = 欢迎使用smokeping监控
menuextra = <a target='_blank' href='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>
+ CNC-OTHER-NODE
menu = 联通NODE
title = 联通NODE
nomasterpoll = yes
++ zhengzhou
menu = 郑州联通
title = 郑州联通
alerts = someloss,rttdetect
slaves = beijingcnc
host = 182.118.x.x
+++ zhengzhou
menu = 郑州联通
title = 郑州联通
alerts =
slaves = huhehaotecnc shenyangcnc taiyuancnc tianjincnc guangzhoucnc shijiazhuangcnc
host = 182.118.x.x
+ Test
menu = 测试
title = 测试
nomasterpoll = yes
++ TW
menu = 台湾
title = 台湾
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 60.199.217.26
++ HK
menu = 香港
title = 香港
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 205.177.132.67
++ KR
menu = 韩国
title = 韩国
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 218.156.80.2
++ US
menu = 美国
title = 美国
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 63.236.67.45
++ UK
menu = 英国
title = 英国
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 23.15.14.33
++ CA
menu = 加拿大
title = 加拿大
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 75.125.235.163
++ JA
menu = 日本
title = 日本
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 61.152.144.67
++ XJ
menu = 新加坡
title = 新加坡
alerts =
slaves = beijingcnc yizhuangctc-waiwang nanningctc nanchangctc
host = 64.145.95.41
1 此处定义节点由于较多所以只写了一个郑州
2 此配置文件针对监控优先级报警 采用了3层目录形式 可针对自己想监控的节点进行报警,极大降 低了误报 3 Alerts定义多种规则,针对不通网络质量采用不通阀值
当然smokeping也支持如RTX 飞信等报警 需要手工写一些脚本或添加相应程序实现
目录结构 |-- bin
| |-- restart.sh
| |-- smokeinfo
| |-- smokeping
| |-- smokeping_cgi
| `-- tSmoke
|-- etc
| |-- basepage.html.dist
| |-- config
| |-- config.dist
| |-- config.new
| |-- examples
| | |-- config.echoping
| | |-- config.fping-instances
| | |-- config.multiple-probes
| | |-- config.simple
| | |-- config.targetvars-with-Curl
| | `-- config.template
| |-- smokemail.dist
| |-- smokeping_secrets.dist
| `-- tmail.dist
|-- htdocs
| |-- cache
| | |-- __navcache
| | | |-- 13695687927004_1369568792_1369445400.png
| | | |-- 13695690947069_1369569094_1369445400.png
| | | |-- 13695693977146_1369569397_1369445400.png
| | | |-- 13695696997262_1369569699_1369445400.png
| | | |-- 13695700027339_1369570002_1369445400.png
| | | |-- 13695703047404_1369570304_1369445400.png
| | | |-- 13695706077489_1369570607_1369445400.png
| | | |-- 13695709107554_1369570910_1369445400.png
| | | |-- 13695712127631_1369571212_1369445400.png
| | | |-- 13695715157757_1369571515_1369445400.png
| | | |-- 13695718187834_1369571818_1369445400.png
| | | `-- 13695721217901_1369572121_1369445400.png
| | |-- beimei
| | | |-- BM-BM199.maxheight~beimei
| | | |-- BM-BM199_mini.png
| | | |-- BM-BM199~beimei_last_2592000.png
| | | |-- BM-BM199~beimei_last_604800.png
| | | |-- BM-BM199~beimei_last_86400.png
| | | |-- BM-BM208.maxheight~beimei
| | | |-- BM-BM208_mini.png
| | | |-- BM-BM208~beimei_last_2592000.png
| | | |-- BM-BM208~beimei_last_604800.png
| | | |-- BM-BM208~beimei_last_86400.png
| | | |-- BM-MLXY.maxheight~beimei
| | | |-- BM-MLXY_mini.png
| | | |-- BM-MLXY~beimei_last_2592000.png
| | | |-- BM-MLXY~beimei_last_604800.png
| | | |-- BM-MLXY~beimei_last_86400.png
| | | |-- BM-OPS.maxheight~beimei
| | | |-- BM-OPS_mini.png
| | | |-- BM-OPS~beimei_last_2592000.png
| | | |-- BM-OPS~beimei_last_604800.png
| | | |-- BM-OPS~beimei_last_86400.png
| | | |-- BM-XJP203.maxheight~beimei
| | | |-- BM-XJP203_mini.png
| | | |-- BM-XJP203~beimei_last_2592000.png
| | | |-- BM-XJP203~beimei_last_604800.png
| | | |-- BM-XJP203~beimei_last_86400.png
| | | |-- BM-XJP27.maxheight~beimei
| | | |-- BM-XJP27_mini.png
| | | |-- BM-XJP27~beimei_last_2592000.png
| | | |-- BM-XJP27~beimei_last_604800.png
| | | |-- BM-XJP27~beimei_last_86400.png
| | | |-- BM-YN.maxheight~beimei
| | | |-- BM-YN_mini.png
| | | |-- BM-YN~beimei_last_2592000.png
| | | |-- BM-YN~beimei_last_604800.png
| | | `-- BM-YN~beimei_last_86400.png
| | |-- rrdtool.png
| | |-- smokeping.png
| | `-- xinjiapo
| | |-- XJP-BM199.maxheight~xinjiapo
| | |-- XJP-BM199_mini.png
| | |-- XJP-BM199~xinjiapo_last_2592000.png
| | |-- XJP-BM199~xinjiapo_last_604800.png
| | |-- XJP-BM199~xinjiapo_last_86400.png
| | |-- XJP-BM203.maxheight~xinjiapo
| | |-- XJP-BM203_mini.png
| | |-- XJP-BM203~xinjiapo_last_2592000.png
| | |-- XJP-BM203~xinjiapo_last_604800.png
| | |-- XJP-BM203~xinjiapo_last_86400.png
| | |-- XJP-MLXY.maxheight~xinjiapo
| | |-- XJP-MLXY_mini.png
| | |-- XJP-MLXY~xinjiapo_last_2592000.png
| | |-- XJP-MLXY~xinjiapo_last_604800.png
| | |-- XJP-MLXY~xinjiapo_last_86400.png
| | |-- XJP-OPS.maxheight~xinjiapo
| | |-- XJP-OPS_mini.png
| | |-- XJP-OPS~xinjiapo_last_2592000.png
| | |-- XJP-OPS~xinjiapo_last_604800.png
| | |-- XJP-OPS~xinjiapo_last_86400.png
| | |-- XJP-YN.maxheight~xinjiapo
| | |-- XJP-YN_mini.png
| | |-- XJP-YN~xinjiapo_last_2592000.png
| | |-- XJP-YN~xinjiapo_last_604800.png
| | `-- XJP-YN~xinjiapo_last_86400.png
| |-- cropper
| | |-- cropper.css
| | |-- cropper.js
| | |-- cropper.uncompressed.js
| | |-- lib
| | | |-- builder.js
| | | |-- controls.js
| | | |-- dragdrop.js
| | | |-- effects.js
| | | |-- prototype.js
| | | |-- scriptaculous.js
| | | |-- slider.js
| | | |-- sound.js
| | | `-- unittest.js
| | |-- licence.txt
| | |-- marqueeHoriz.gif
| | |-- marqueeVert.gif
| | `-- smokeping-zoom.js
| |-- data
| | |-- __sortercache
| | | `-- data.FPing.storable
| | |-- beimei
| | | |-- BM-BM199.rrd
| | | |-- BM-BM199~beimei.rrd
| | | |-- BM-BM208.rrd
| | | |-- BM-BM208~beimei.rrd
| | | |-- BM-MLXY.rrd
| | | |-- BM-MLXY~beimei.rrd
| | | |-- BM-OPS.rrd
| | | |-- BM-OPS~beimei.rrd
| | | |-- BM-XJP203.rrd
| | | |-- BM-XJP203~beimei.rrd
| | | |-- BM-XJP27.rrd
| | | |-- BM-XJP27~beimei.rrd
| | | |-- BM-YN.rrd
| | | `-- BM-YN~beimei.rrd
| | `-- xinjiapo
| | |-- XJP-BM199.rrd
| | |-- XJP-BM199.xinjiapo.slave_cache
| | |-- XJP-BM199~xinjiapo.rrd
| | |-- XJP-BM203.rrd
| | |-- XJP-BM203.xinjiapo.slave_cache
| | |-- XJP-BM203~xinjiapo.rrd
| | |-- XJP-MLXY.rrd
| | |-- XJP-MLXY.xinjiapo.slave_cache
| | |-- XJP-MLXY~xinjiapo.rrd
| | |-- XJP-OPS.rrd
| | |-- XJP-OPS.xinjiapo.slave_cache
| | |-- XJP-OPS~xinjiapo.rrd
| | |-- XJP-YN.rrd
| | |-- XJP-YN.xinjiapo.slave_cache
| | `-- XJP-YN~xinjiapo.rrd
| |-- smokeping.cgi
| |-- smokeping.fcgi.dist
| |-- var
| | |-- smokeping.log
| | `-- smokeping.pid
| `-- weathermap
| |-- beimei.html
| |-- beimei.png
| |-- gamewave.html
| |-- overlib.js
| |-- xinjiapo.html
| `-- xinjiapo.png
|-- lib
| |-- BER.pm
| |-- SNMP_Session.pm
| |-- SNMP_util.pm
| |-- Smokeping
| | |-- Colorspace.pm
| | |-- Config.pm
| | |-- Examples.pm
| | |-- Graphs.pm
| | |-- Info.pm
| | |-- Master.pm
| | |-- RRDhelpers.pm
| | |-- RRDtools.pm
| | |-- Slave.pm
| | |-- ciscoRttMonMIB.pm
| | |-- matchers
| | | |-- Avgratio.pm
| | | |-- CheckLatency.pm
| | | |-- CheckLoss.pm
| | | |-- ExpLoss.pm
| | | |-- Median.pm
| | | |-- Medratio.pm
| | | `-- base.pm
| | |-- pingMIB.pm
| | |-- probes
| | | |-- AnotherDNS.pm
| | | |-- AnotherSSH.pm
| | | |-- CiscoRTTMonDNS.pm
| | | |-- CiscoRTTMonEchoICMP.pm
| | | |-- CiscoRTTMonTcpConnect.pm
| | | |-- Curl.pm
| | | |-- DNS.pm
| | | |-- DismanPing.pm
| | | |-- EchoPing.pm
| | | |-- EchoPingChargen.pm
| | | |-- EchoPingDNS.pm
| | | |-- EchoPingDiscard.pm
| | | |-- EchoPingHttp.pm
| | | |-- EchoPingHttps.pm
| | | |-- EchoPingIcp.pm
| | | |-- EchoPingLDAP.pm
| | | |-- EchoPingPlugin.pm
| | | |-- EchoPingSmtp.pm
| | | |-- EchoPingWhois.pm
| | | |-- FPing.pm
| | | |-- FPing6.pm
| | | |-- FTPtransfer.pm
| | | |-- IOSPing.pm
| | | |-- LDAP.pm
| | | |-- OpenSSHJunOSPing.pm
| | | |-- Radius.pm
| | | |-- RemoteFPing.pm
| | | |-- SSH.pm
| | | |-- SipSak.pm
| | | |-- TCPPing.pm
| | | |-- TacacsPlus.pm
| | | |-- TelnetIOSPing.pm
| | | |-- TelnetJunOSPing.pm
| | | |-- WebProxyFilter.pm
| | | |-- base.pm
| | | |-- basefork.pm
| | | |-- basevars.pm
| | | |-- passwordchecker.pm
| | | `-- skel.pm
| | `-- sorters
| | |-- Loss.pm
| | |-- Max.pm
| | |-- Median.pm
| | |-- StdDev.pm
| | `-- base.pm
| `-- Smokeping.pm
|-- share
| `-- man
| |-- man1
| | |-- smokeping.1
| | |-- smokeping_cgi.1
| | `-- tSmoke.1
| |-- man3
| | |-- Smokeping_matchers_Avgratio.3
| | |-- Smokeping_matchers_CheckLatency.3
| | |-- Smokeping_matchers_CheckLoss.3
| | |-- Smokeping_matchers_ExpLoss.3
| | |-- Smokeping_matchers_Median.3
| | |-- Smokeping_matchers_Medratio.3
| | |-- Smokeping_matchers_base.3
| | |-- Smokeping_probes_AnotherDNS.3
| | |-- Smokeping_probes_AnotherSSH.3
| | |-- Smokeping_probes_CiscoRTTMonDNS.3
| | |-- Smokeping_probes_CiscoRTTMonEchoICMP.3
| | |-- Smokeping_probes_CiscoRTTMonTcpConnect.3
| | |-- Smokeping_probes_Curl.3
| | |-- Smokeping_probes_DNS.3
| | |-- Smokeping_probes_DismanPing.3
| | |-- Smokeping_probes_EchoPing.3
| | |-- Smokeping_probes_EchoPingChargen.3
| | |-- Smokeping_probes_EchoPingDNS.3
| | |-- Smokeping_probes_EchoPingDiscard.3
| | |-- Smokeping_probes_EchoPingHttp.3
| | |-- Smokeping_probes_EchoPingHttps.3
| | |-- Smokeping_probes_EchoPingIcp.3
| | |-- Smokeping_probes_EchoPingLDAP.3
| | |-- Smokeping_probes_EchoPingPlugin.3
| | |-- Smokeping_probes_EchoPingSmtp.3
| | |-- Smokeping_probes_EchoPingWhois.3
| | |-- Smokeping_probes_FPing.3
| | |-- Smokeping_probes_FPing6.3
| | |-- Smokeping_probes_FTPtransfer.3
| | |-- Smokeping_probes_IOSPing.3
| | |-- Smokeping_probes_LDAP.3
| | |-- Smokeping_probes_OpenSSHJunOSPing.3
| | |-- Smokeping_probes_Radius.3
| | |-- Smokeping_probes_RemoteFPing.3
| | |-- Smokeping_probes_SSH.3
| | |-- Smokeping_probes_SipSak.3
| | |-- Smokeping_probes_TCPPing.3
| | |-- Smokeping_probes_TacacsPlus.3
| | |-- Smokeping_probes_TelnetIOSPing.3
| | |-- Smokeping_probes_TelnetJunOSPing.3
| | |-- Smokeping_probes_WebProxyFilter.3
| | |-- Smokeping_probes_base.3
| | |-- Smokeping_probes_basefork.3
| | |-- Smokeping_probes_basevars.3
| | |-- Smokeping_probes_passwordchecker.3
| | |-- Smokeping_probes_skel.3
| | |-- Smokeping_sorters_Loss.3
| | |-- Smokeping_sorters_Max.3
| | |-- Smokeping_sorters_Median.3
| | |-- Smokeping_sorters_StdDev.3
| | `-- Smokeping_sorters_base.3
| |-- man5
| | |-- smokeping_config.5
| | `-- smokeping_examples.5
| `-- man7
| |-- smokeping_extend.7
| |-- smokeping_install.7
| |-- smokeping_master_slave.7
| `-- smokeping_upgrade.7
`-- var
1 smokeping.cgi 放置在 htdocs下 #!/bin/sh
#export PERL5LIB=/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/
exec /usr/local/smokeping/bin/smokeping_cgi /usr/local/smokeping/etc/config
让smokeping_cgi读取配置文件执行 2 smokeping生成的cache图片按照定义时间来定义 last_ 后面的数值 3 必须刷新url才可生成cache图片,可定期使用脚本刷新 4 secrets文件权限600
5 smokeping服务端启动脚本 killall -9 smokeping
/usr/local/smokeping/bin/smokeping --config=/usr/local/smokeping/etc/config --logfile=/usr/local/smokeping/htdocs/var/smokeping.log 6 smokeping客户端启动脚本 #!/bin/bash
MASTERURL=http://xxx.xx.xx.xx/htdocs/smokeping.cgi
SLAVENAME=
CACHEDIR=/usr/local/smokeping/cache
PIDFILE=$CACHEDIR/smokeping.pid
SECRET=/usr/local/smokeping/etc/secrets
LOGFILE=/usr/local/smokeping/var/smoke.log
RUNNING=0
if [ -f $PIDFILE ] ; then
PID=`cat $PIDFILE`
if kill -0 $PID 2>/dev/null ; then
echo "smokeping is running with PID $PID"
exit 0
else
echo "smokeping not running but PID file exists => delete PID file"
rm -f $PIDFILE
fi
else
echo "smokeping (no pid file) not running"
fi
if
/usr/local/smokeping/bin/smokeping --master-url=$MASTERURL --slave-name=$SLAVENAME --cache-dir=$CACHEDIR --shared-secret=$SECRET --logfile=$LOGFILE > /dev/null; then
echo "smokeping started"
else
echo "smokeping could not be started"
fi
欢迎大家交流或给我留言
|