smokeping installation

 

1. 安装CentOS5.4, 需安装Development Libraries、Development Tools和Web Server组件;

2. 添加 /etc/yum.repos.d/dag.repo, 并编辑

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

3.安装如下组件

 

yum install rrdtool perl-CGI-SpeedyCGI fping httpd perl-libwww-perl.noarch fontconfig freetype dejavu-lgc-fonts.noarch

 

4.安装并配置smokeping

 

wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz

tar xvzf smokeping-2.4.2.tar.gz

mv smokeping-2.4.2 /usr/local/smokeping

chown -R root:root /usr/local/smokeping

cd /usr/local/smokeping/bin

for foo in *.dist; do cp $foo `basename $foo .dist`; done

cd  /usr/local/smokeping/etc/

for foo in *.dist; do cp $foo `basename $foo .dist`; done

cd /usr/local/smokeping/htdocs

for foo in *.dist; do cp $foo `basename $foo .dist`; done

 

vi /usr/local/smokeping/bin/smokeping

·         change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);

·         to > use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);

·         change > use lib qw(lib);

·         to > use lib qw(/usr/local/smokeping/lib);

·         change > Smokeping::main(“etc/config.dist”);

·         to > Smokeping::main(“/usr/local/smokeping/etc/config”);

 

vi /usr/local/smokeping/htdocs/smokeping.cgi

·         change > use lib qw(/usr/pack/rrdtool-1.3.0-rp/lib/perl);

·         to > use lib qw(/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/RRDs);

·         change > use lib qw(/home/oetiker/checkouts/smokeping/trunk/software/lib);

·         to > use lib qw(/usr/local/smokeping/lib);

·         change > Smokeping::cgi(“/home/oetiker/checkouts/smokeping/trunk/software/etc/config.dist”);

·         to > Smokeping::cgi(“/usr/local/smokeping/etc/config”);

cp /usr/local/smokeping/htdocs/smokeping.cgi /var/www/cgi-bin

 

5. 编辑/usr/local/smokeping/etc/config

 *** General ***

owner    = Gino Sun
contact  = [email protected]
mailhost = 10.16.42.20
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://10.16.169.149/smokeping/img
datadir = /usr/local/smokeping/var
piddir = /usr/local/smokeping/var
cgiurl = http://10.16.169.149/cgi-bin/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 = no

*** Alerts ***
to = [email protected]
from = [email protected]

+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 = /usr/local/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
packetsize = 64

*** 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= Targets
##parents = owner:/Test/James location:/

#++ James

#menu = James
#title =James
#alerts = someloss
#slaves = boomer slave2
#host = james.address

#++ MultiHost

#menu = Multihost
#title = James and James as seen from Boomer
#host = /Test/James /Test/James~boomer
 

6. 增加目录

 

mkdir -p /var/www/html/smokeping/img

chown -R apache:apache /var/www/html/smokeping/img

mkdir /usr/local/smokeping/var

/usr/local/smokeping/bin/smokeping &

 7. 启动somkeping

 

Start service

/usr/local/smokeping/bin/smokeping

/etc/init.d/httpd restart

 

Apache&SpokePing Auto start after server reboot

 

Chkconfig –level 35 httpd on

 

vi /etc/rc.local

add

/usr/local/smokeping/bin/smokeping &

 

 

./smokeping --master-url=http://10.16.169.149/cgi-bin/smokeping.cgi  --cache-dir=/var/tmp/smokeping/  --shared-secret= /usr/local/smokeping/etc/smokeping_secrets.dist  --slave-name=slave1

 

 

本文出自 “gino” 博客,转载请与作者联系!

你可能感兴趣的:(职场,网络监控,休闲)