修改配置文件
形如:其中,标红部分需要根据实际路径和情况修改。
1./var/www/html/smokeping/etc/config文件
[iyunv@cdn18 etc]# more config
*** General ***
owner = Peter Random
contact = some@address.nowhere
mailhost = my.mail.host
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/htdocs/cache
#imgcache = /home/oetiker/public_html/smokeping-ms/cache
imgurl = http://192.168.10.18:8080/smokeping/cache
#imgurl = cache
datadir = /var/www/html/smokeping/data
#datadir = /tmp/smokeping-ms/data
piddir = /var/www/html/smokeping/var
#piddir = /tmp/smokeping-ms/var
cgiurl = http://192.168.10.18:8080/smokeping/smokeping.cgi
smokemail = /var/www/html/smokeping/etc/smokemail
#smokemail = /home/oetiker/checkouts/smokeping/trunk/software/etc/smokemail.dist
tmail = /var/www/html/smokeping/etc/tmail.dist
#tmail = /home/oetiker/checkouts/smokeping/trunk/software/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
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= Targets
#parents = owner:/Test/James location:/
++ James
menu = James
title =James
alerts = someloss
slaves = boomer slave2
host = 192.168.10.18
++ MultiHost
menu = Multihost
title = James and James as seen from Boomer
host = /Test/James /Test/James~boomer
+ DunHuang
menu = DunHuang
title = DunHuang
++ dhyk18
menu = dhyk18
title = dhyk18
host = 192.168.10.18
++ dhyk19
menu = dhyk19
title = dhyk19
host = 192.168.10.19
#use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
use lib qw(/usr/local/rrdtool/lib/perl/);
use lib qw(/var/www/html/smokeping/lib);
#use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
use CGI::Carp qw(fatalsToBrowser);
(4)配置apache /conf/httpd.conf
Alias /smokeping/ "/var/www/html/smokeping/htdocs/"
Alias /cache/ "/var/www/html/smokeping/cache/"
<Directory "/var/www/html/smokeping/htdocs">
Options FollowSymLinks ExecCGI
AllowOverride None
AddHandler cgi-script cgi
Order allow,deny
Allow from all
</Directory>
(2)检查smokeping配置文件:
[iyunv@smokeping ~]# /usr/local/smokeping/bin/smokeping --check
Configuration file '/usr/local/smokeping/etc/config' syntax OK.
(3)启动smokeping:(无法启动)
[iyunv@smokeping ~]# service smokeping start
ERROR: slave 'boomer' is not defined in the '*** Slaves ***' section!
/etc/init.d/smokeping start: smokeping could not be started
[iyunv@smokeping ~]# service smokeping restart
ERROR: /usr/local/smokeping/etc/config, line 111: File '/usr/local/smokeping/etc/smokeping_secrets.dist' is world-readable or writable, refusing it
/etc/init.d/smokeping start: smokeping could not be started
[iyunv@smokeping src]# ll /usr/local/smokeping/etc/smokeping_secrets.dist
-rw-r--r-- 1 apache apache 59 Aug 21 2007 /usr/local/smokeping/etc/smokeping_secrets.dist
[iyunv@smokeping src]# chmod 400 /usr/local/smokeping/etc/smokeping_secrets.dist
[iyunv@smokeping src]# ll /usr/local/smokeping/etc/smokeping_secrets.dist
-r-------- 1 apache apache 59 Aug 21 2007 /usr/local/smokeping/etc/smokeping_secrets.dist
[iyunv@smokeping ~]# ./smokeping restart
WARNING: Hostname 'james.address' does currently not resolve to an IPv6 or IPv4 address
ERROR: slave 'boomer' is not defined in the '*** Slaves ***' section!
/etc/init.d/smokeping start: smokeping could not be started
*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
location=dh
color=00ffff
+192.168.10.18
display_name=192.168.10.18
location=dh
color=0000ff
++override
Probes.FPing.binary = /usr/local/sbin/fping
Probes.FPing.sourceaddress = 192.168.10.18
+slave2
display_name=another
color=00ff00
[iyunv@smokeping ~]# service smokeping restart
/etc/init.d/smokeping start: smokeping started
[iyunv@smokeping ~]#
[iyunv@smokeping ~]# service httpd restart
Stopping httpd: [ OK ]