smokeping依托于web server通过CGI-speedyCGI模块进行显示。常用于IDC机房带宽的测试,包含多种探测方式,包括fping、echoping、dig、curl等。 smokeping向目标设备发送数据包,进行记录、展示RTT。RTT (Round-Trip Time) 这个值就是数据包在源和监控点一个来回所需要用的时间,是判断网络运行状况的一个重要的参数。在网络中实时、准确测量大量的TCP设备和系统RTT参数也是网络管理的重要环节之一。
smokeping是对IDC网络质量,稳定性等最好的检测工具,包括常规的 ping,dig,echoping,curl等,可以 监视 www 服务器性能,监视 dns 查询性能,监视 ssh 性能等。选择smokeping我觉得有以下原因:
1,最佳的画图功能,延迟和丢包用颜色和阴影表示很直观。
2,免费和开源,作者是MRTG和RRDtool作者。
3,支持主从的分布式模式。
4,可以自定义报警功能。
前言:
本文使用YUM安装其他资源包,编译安装smokeping方式。apt.sw.be这个第三方软件仓库,我觉得很不错,更新很快,资源很全。但是这个源很不稳定。
1 使用apt.sw.be源(安装前的准备):
#yum update
#rpm -Uvh http://apt.sw.be/redhat/el5/en/x ... 2.el5.rf.x86_64.rpm
探讨一个工作中经常出现的yum报错:Metadata file does not match checksum
可能会出现:http://www.mirrorservice.org/sit ... data/primary.xml.gz(不是本文原来的那个报错路径):
[Errno -1] Metadata file does not match checksum 这样的错误,原理是当生成metadata数据的时候,会一同产生校验数据。而传输的时候,会用该校验数据判断metadata是否完整。在这里会下载 other.xml.gz filelists.xml.gz primary.xml.gz,repomd.xml四个文件,其中repomd.xml包含其他三个文件的校检内容,如下是检查效果:
# sha1sum other.xml.gz filelists.xml.gz primary.xml.gz
497fbed7cddb2f60265c482331af6ac36b7f2720 other.xml.gz
e7fb32d7e1e683a57b3391e949cc98d9afec1e50 filelists.xml.gz
70ba2a3faf75b8db9a15a01efafbc1b36ffbc1a9 primary.xml.gz
和repomd.xml的内容对比:
# cat repomd.xml |grep -w ‘checksum’|grep -v ‘open-checksum’
<checksum type=”sha”>497fbed7cddb2f60265c482331af6ac36b7f2720</checksum>
<checksum type=”sha”>e7fb32d7e1e683a57b3391e949cc98d9afec1e50</checksum>
<checksum type=”sha”>78a5ab04536a34f691606ebd1244fd63c548610c</checksum>
发现primary.xml.gz的校检有问题。
我用了以下办法:
1 使用–cache=off 用于清除缓存,这个方法其他还是有些作用的,有些时候会成功,就是将文件下载到本地,然后yum时候就不会去下载它了
#wget –cache=off http://www.mirrorservice.org/sit ... data/primary.xml.gz
2 使用多线程工具下载到/var/cache/yum/,我使用的是myget
3 使用–no-cache参数并修改/etc/yum.conf,添加http_caching=none
wget –no-cache http://www.mirrorservice.org/sit ... data/primary.xml.gz
但是都没有成功,后来我发现:当我wget下载primary.xml.gz时候,下载的地址被重定向了
最后一个强烈建议,使用yum makecache ,将服务器上的软件包信息 现在本地缓存,以提高 搜索 安装软件的速度,可以做成定时任务。
最后在我的不懈尝试下,终于成功更新了。
2 安装smokeping
# yum install httpd
# yum install rrdtool
# yum install fping
# yum install echoping
# yum install curl
# yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI
# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz
# tar zxvf smokeping-2.4.2.tar.gz
# mv smokeping-2.4.1 /opt/smokeping
# cd /opt/smokeping/bin
# cp smokeping.dist smokeping
# cd ../htdocs/
# cp smokeping.cgi.dist smokeping.cgi
# cp tr.cgi.dist tr.cgi
# cd ../etc/
# cp config.dist config
# cp basepage.html.dist basepage.html
# cp smokemail.dist smokemail
# cp tmail.dist tmail
# cp smokeping_secrets.dist smokeping_secrets
# chmod 600 /opt/smokeping/etc/smokeping_secrets
3 配置smokeping
编辑/opt/smokeping/bin/smokeping
修改一下内容:
#!/usr/sepp/bin/perl-5.8.4 -w
# -*-perl-*-
use lib qw(/usr/pack/rrdtool-1.2.23-mo/lib/perl);
use lib qw(lib);
use Smokeping 2.004002;
Smokeping::main("etc/config.dist");
为
#!/usr/bin/perl -w
# -*-perl-*-
use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs/);(这个和编译安装的路径不同,注意)
use lib qw(/opt/smokeping/lib);
use Smokeping 2.004002;
Smokeping::main("/opt/smokeping/etc/config");
编辑/opt/smokeping/htdocs/smokeping.cgi
修改以下内容:
#!/usr/sepp/bin/speedy -w
# -*-perl-*-
use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.004002;
smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config");
为
#!/usr/bin/speedy -w
# -*-perl-*-
use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);(这个和编译安装的也不相同)
use lib qw(/opt/smokeping/lib);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.004002;
Smokeping::cgi("/opt/smokeping/etc/config");
编辑/opt/smokeping/htdocs/tr.cgi
修改以下内容:
#!/usr/sepp/bin/speedy-5.8.8 -w
use strict;
use lib qw(/home/oposs/smokeping/software/lib);
use lib qw(perl);
为
#!/usr/bin/speedy -w
use strict;
use lib qw(/opt/smokeping/lib);
use lib qw(perl);
编辑/opt/smokeping/etc/basepage.html
修改以下内容
<script src="cropper/lib/prototype.js" type="text/javascript"></script>
<script src="cropper/lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="cropper/cropper.js" type="text/javascript"></script>
<script src="cropper/smokeping-zoom.js" type="text/javascript"></script>
修改traceroute权限
chmod 4775 /bin/traceroute
编辑apache配置:
去掉AddHandler cgi-script .cgi前面的注释
修改一下内容:<script src="cropper/lib/prototype.js" type="text/javascript"></script>
<pre><script src="cropper/lib/scriptaculous.js?load=builder,dragdrop"></script></pre>
<pre><script src="cropper/cropper.js"></script></pre>
<script src="cropper/smokeping-zoom.js" type="text/javascript"></script>
为
<script src="/smokeping/cropper/lib/prototype.js" type="text/javascript"></script>
<script src="/smokeping/cropper/lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="/smokeping/cropper/cropper.js" type="text/javascript"></script>
<script src="/smokeping/cropper/smokeping-zoom.js" type="text/javascript"></script>
编辑/opt/smokeping/htdocs/tr.html
修改为:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmokeTrace</title>
<script src="/script/Tr.js"></script>
</head>
</html>
编辑/opt/smokeping/etc/config
*** General ***
owner = DONGWM
contact = dongwm@dongwm.com
mailhost = dongwm.com
sendmail = /usr/sbin/sendmail
imgcache = /opt/smokeping/htdocs/cache
imgurl = http://192.168.9.100/cache
datadir = /opt/smokeping/data
piddir = /opt/smokeping/var
cgiurl = http://192.168.9.100/smokeping/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail
tmail = /opt/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 = no
*** Alerts ***
to = alertee@address.somewhere
from = autopost@dongwm.com
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
*** Database ***
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 = /opt/smokeping/etc/basepage.html
+ 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
*** Targets ***
menuextra = <a target='_blank' href='/smokeping/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;">(TR)</a>
probe = FPing
menu = Top
title = Dongwm.com
remark = Welcome to dongwm.com
+ hosts
menu= Targets
++ dongwm.com
menu = dongwm.com
title = dongwm.com
alerts = someloss
host = dongwm.com
++ salogs.com
menu = salogs.cm
title = salogs.com
alerts = someloss
host = salogs.com
创建一个启动脚本:
#vi /etc/init.d/smokeping
添加为以下内容:
#!/bin/bash
#
# chkconfig: 2345 80 05
# Description: Smokeping init.d script
# Hacked by : How2CentOS - http://www.how2centos.com
# Get function from functions library
. /etc/init.d/functions
# Start the service Smokeping
start() {
echo -n "Starting Smokeping: "
/opt/smokeping/bin/smokeping >/dev/null 2>&1
### Create the lock file ###
touch /var/lock/subsys/smokeping
success $"Smokeping startup"
echo
}
# Restart the service Smokeping
stop() {
echo -n "Stopping Smokeping: "
kill -9 `ps ax | grep "/opt/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1 }'`>/dev/null 2>&1
### Now, delete the lock file ###
rm -f /var/lock/subsys/smokeping
success $"Smokeping shutdown"
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status Smokeping
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
# chmod 755 /etc/init.d/smokeping
最后启动服务:
# chkconfig smokeping on
# chkconfig httpd on
# service smokeping start
Starting Smokeping: [ OK ]
# service httpd start
Starting httpd: [ OK ]
网页访问:http://192.168.9.100/smokeping/smokeping.cgi
因工作需要,安装了个smokeping系统!
因工作需要,安装了个smokeping系统! 最近,有个客户老是担心自己的专线质量有问题,特别是访问外省网的问题。我回复说“大哥,现在国内的网络ISP,一般只保证本地接入没问题就可以了。谁都保证不了大网的问题”。但没办法,人家是客户,怎么也得做点功夫。于是,我决定搭个smokeping系统,然后设定几个外省测试点,生成质量给他看。
安装环境:centos 5.4 安装步骤: 1、centos安装,省略,我默认大家都会了。呵呵 2、yum update
更新一下系统软件 3、更新一下安装源
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
4、安装httpd
yum install httpd
5、安装探针
yum install rrdtool
yum install fping
yum install echoping
yum install curl
yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI
5、下载安装smokeping
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz //下载smokeping软件,我是保存到/root目录下的
tar zxvf smokeping-2.4.2.tar.gz
//解压软件包
mv smokeping-2.4.2 /opt/smokeping
//把软件包移动到/opt目录下,本软件不需要安装,直接解压即可使用 cd /opt/smokeping
cd bin/
cp smokeping.dist smokeping
cd ../htdocs/
cp smokeping.cgi.dist smokeping.cgi
cp tr.cgi.dist tr.cgi
cd ../etc/
cp config.dist config
cp basepage.html.dist basepage.html
cp smokemail.dist smokemail
cp tmail.dist tmail
cp smokeping_secrets.dist smokeping_secrets
//到各目录下建立文件 chmod 600 /opt/smokeping/etc/smokeping_secrets
//修改权限 6、修改配置文件: 1)vim /opt/smokeping/bin/smokeping
Replace this:
!/usr/sepp/bin/perl-5.8.4 -w
-*-perl-*-
use lib qw(/usr/pack/rrdtool-1.2.23-mo/lib/perl);
use lib qw(lib);
use Smokeping 2.004000;
Smokeping::main("etc/config.dist");
把以上红色部分修改成如下加粗的部分:
!/usr/bin/perl -w
-*-perl-*-
use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs/);
use lib qw(/opt/smokeping/lib);
use Smokeping 2.004000;
Smokeping::main("/opt/smokeping/etc/config");
2) vim /opt/smokeping/htdocs/smokeping.cgi Replace this:
!/usr/sepp/bin/speedy -w
-*-perl-*-
use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.004000;
Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config");
把以上红色部分修改成如下加粗的部分: !/usr/bin/speedy -w
-*-perl-*-
use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);
use lib qw(/opt/smokeping/lib);
use CGI::Carp qw(fatalsToBrowser);
use Smokeping 2.004000;
Smokeping::cgi("/opt/smokeping/etc/config");
3)vim /opt/smokeping/htdocs/tr.cgi
Change this:
!/usr/sepp/bin/speedy-5.8.8 -w
use strict;
use lib qw(/home/oposs/smokeping/software/lib);
use lib qw(perl);
把以上红色部分修改成如下加粗的部分: #!/usr/bin/speedy -w
use strict;
use lib qw(/opt/smokeping/lib);
use lib qw(perl);
7、创建HTTP访问的目录与文件 mkdir -p /var/www/html/smokeping/img /var/www/html/smokeping/script/ /opt/smokeping/data /opt/smokeping/var
chown -R apache:apache /var/www/html/smokeping/img
ln -s /opt/smokeping/htdocs/cropper /var/www/html/smokeping/cropper
ln -s /opt/smokeping/htdocs/resource /var/www/html/smokeping/resource
ln -s /opt/smokeping/htdocs/script/Tr.js /var/www/html/smokeping/script/Tr.js
ln -s /opt/smokeping/htdocs/smokeping.cgi /var/www/html/smokeping/smokeping.cgi
ln -s /opt/smokeping/htdocs/tr.cgi /var/www/html/smokeping/tr.cgi
8、修改traceroute权限
chmod 4775 /bin/traceroute
9、修改http配置文件 vim /etc/httpd/conf/httpd.conf
change > AddHandler cgi-script .cgi
to > AddHandler cgi-script .cgi
Under <Directory “/var/www/html”>
change> Options Indexes FollowSymLinks
to > Options Indexes FollowSymLinks ExecCGI
10、修改basepage.html配置文件
vim /opt/smokeping/etc/basepage.html
Change this:
<script src="cropper/lib/prototype.js" type="text/javascript"></script>
<script src="cropper/lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="cropper/cropper.js" type="text/javascript"></script>
<script src="cropper/smokeping-zoom.js" type="text/javascript"></script> To this:
<script src="/smokeping/cropper/lib/prototype.js" type="text/javascript"></script>
<script src="/smokeping/cropper/lib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="/smokeping/cropper/cropper.js" type="text/javascript"></script>
<script src="/smokeping/cropper/smokeping-zoom.js" type="text/javascript"></script>
11、修改tr.html配置
vim /opt/smokeping/htdocs/tr.html
Change this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmokeTrace</title>
<script type="text/javascript" src="script/Tr.js"></script>
</head>
</html> To this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SmokeTrace</title>
<script type="text/javascript" src="/script/Tr.js"></script>
</head>
</html>
12、软连接
ln -s /opt/smokeping/htdocs/tr.html /var/www/html/smokeping/tr.html 13、修改配置文件,我的配置文件如下: *** General *** owner = Kang
contact = 1079841346@qq.com
mailhost = smtp.qq.com
sendmail = /usr/lib/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 = /var/www/html/smokeping/img imgurl = http://120.X.X.X/smokeping/img datadir = /opt/smokeping/data piddir = /opt/smokeping/var cgiurl = http://120.X.X.Xsmokeping/smokeping.cgi smokemail = /opt/smokeping/etc/smokemail
tmail = /opt/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 = 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 = 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 = /opt/smokeping/etc/basepage.html + 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=/opt/smokeping/etc/smokeping_secrets
#+boomer
#display_name=boomer
#color=0000ff #+slave2
#display_name=another
#color=00ff00 *** Targets ***
menuextra = <a target='_blank' href='/smokeping/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;">(TR)</a>
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of Kang Company. \
Here you will learn all about the latency of our network. + web
menu= web
#parents = owner:/Test/James location:/
title = web ++ cu-guangzhou
menu = cu-guangzhou
title = cu-guangzhou +++ cu-guangzhou-1
menu = cu-guangzhou-1
title = cu-guangzhou-120.80.149.58
host = 120.80.149.58 +++ cu-guangzhou-2
menu = cu-guangzhou-2
title = cu-guangzhou-221.4.65.65
host = 221.4.65.65 +++ cu-guangzhou-3
menu = cu-guangzhou-3
title = cu-guangzhou-120.80.237.57
host = 120.80.237.57 +++ cu-guangzhou-4
menu = cu-guangzhou-4
title = cu-guangzhou-120.80.153.10
host = 120.80.153.10 ++ cu-shanghai
menu = cu-shanghai
title = cu-shanghai +++ cu-shanghai-1
menu = cu-shanghai-1
title = cu-shanghai-112.64.245.1
host = 112.64.245.1
+++ cu-shanghai-2
menu = cu-shanghai-2
title = cu-shanghai-112.64.245.158
host = 112.64.245.158
+++ cu-shanghai-3
menu = ct-shanghai-3
title = ct-shanghai-112.64.247.1
host = 112.64.247.1
++ cu-beijing
menu = cu-beijing
title = cu-beijing +++ cu-beijing-1
menu = cu-beijing-1
title = cu-beijing-219.158.4.1 host = 219.158.4.1 +++ cu-beijing-2
menu = cu-beijing-2
title = cu-beijing-219.158.4.2
host = 219.158.4.2 +++ cu-beijing-3
menu = cu-beijing-3
title = cu-beijing-219.158.4.45
host = 219.158.4.45 +++ cu-beijing-4
menu = cu-beijing-4
title = cu-beijing-61.148.25.95
host = 61.148.25.95 +++ cu-beijing-5
menu = cu-beijing-5
title = cu-beijing-61.148.25.94
host = 61.148.25.94 ++MAN-guangzhou
menu = MAN-guangzhou
title = MAN-guangzhou +++MAN-guangzhou-1
menu = MAN-guangzhou-1
title = MAN-guangzhou-58.248.0.1
host = 58.248.0.1
+++MAN-guangzhou-2
menu = MAN-guangzhou-2
title = MAN-guangzhou-58.248.1.1
host = 58.248.1.1
+++MAN-guangzhou-3
menu = MAN-guangzhou-3
title = MAN-guangzhou-58.248.3.1
host = 58.248.3.1
+++ MAN-guangzhou-4
menu = MAN-guangzhou-4
title = MAN-guangzhou-58.248.4.1
host = 58.248.4.1 +++ MAN-guangzhou-5
menu = MAN-guangzhou-5
title = MAN-guangzhou-58.248.9.1
host = 58.248.9.1 ++MAN-shenzhen
menu = MAN-shenzhen
title = MAN-shenzhen +++MAN-shenzhen-1
menu = MAN-shenzhen-1
title = MAN-shenzhen-58.251.49.202
host = 58.251.49.202
+++MAN-shenzhen-2
menu = MAN-shenzhen-2
title = MAN-shenzhen-58.251.49.129
host = 58.251.49.129
+++MAN-shenzhen-3
menu = MAN-shenzhen-3
title = MAN-shenzhen-58.251.49.130
host = 58.251.49.130 +++MAN-shenzhen-4
menu = MAN-shenzhen-4
title = MAN-shenzhen-58.251.50.2
host = 58.251.50.2 +++MAN-shenzhen-5
menu = MAN-shenzhen-5
title = MAN-shenzhen-58.251.50.1
host = 58.251.50.1 ++MAN-dongguan
menu = MAN-dongguan
title = MAN-dongguan +++MAN-dongguan-1
menu = MAN-dongguan-1
title = MAN-dongguan-58.252.3.20
host = 58.252.3.20 +++MAN-dongguan-2
menu = MAN-dongguan-2
title = MAN-dongguan-58.252.3.1
host = 58.252.3.1 +++MAN-dongguan-3
menu = MAN-dongguan-3
title = MAN-dongguan-120.86.124.18
host = 120.86.124.18 +++MAN-dongguan-4
menu = MAN-dongguan-4
title = MAN-dongguan-120.86.124.21
host = 120.86.124.21
14、创建smokeping执行脚本 touch /etc/init.d/smokeping //创建脚本文件
vim /etc/init.d/smokeping
//增加配置脚本,内容如下:
#!/bin/bash
#
# chkconfig: 2345 80 05
# Description: Smokeping init.d script
# Hacked by : How2CentOS - http://www.how2centos.com
# Get function from functions library
. /etc/init.d/functions
# Start the service Smokeping
start() {
echo -n "Starting Smokeping: "
/opt/smokeping/bin/smokeping >/dev/null 2>&1
### Create the lock file ###
touch /var/lock/subsys/smokeping
success $"Smokeping startup"
echo
}
# Restart the service Smokeping
stop() {
echo -n "Stopping Smokeping: "
kill -9 `ps ax | grep "/opt/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1 }'` >/dev/null 2>&1
### Now, delete the lock file ###
rm -f /var/lock/subsys/smokeping
success $"Smokeping shutdown"
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status Smokeping
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
chmod 755 /etc/init.d/smokeping
//增加可执行权限 15、自动运行等配置:
# chkconfig smokeping on
# chkconfig httpd on
# service smokeping start
Starting Smokeping: [ OK ]
# service httpd start
Starting httpd: [ OK ]
补充: 今天重新安装另外一台服务器,发现到了这和步,有个报错: Mon May 23 19:59:58 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon May 23 20:00:56 2011] [error] [client 192.168.10.103] Directory index forbidden by Options directive: /var/www/html/
[Mon May 23 20:00:57 2011] [error] [client 192.168.10.103] File does not exist: /var/www/html/favicon.ico
[Mon May 23 20:01:07 2011] [error] [client 192.168.10.103] Symbolic link not allowed or link target not accessible: /var/www/html/smokeping/smokeping.cgi
[Mon May 23 20:02:32 2011] [error] [client 192.168.10.103] Symbolic link not allowed or link target not accessible: /var/www/html/smokeping/smokeping.cgi
解决办法: vi /etc/selinux/config 修改如下: SELINUX=disabled
重启系统后恢复正常
16、截图如下:
|