Quote: http://oss.oetiker.ch/smokeping/

About SmokePing

Graphics

SmokePing is a deluxe latency measurement tool. It can measure, store and display latency, latency distribution and packet loss. SmokePing uses RRDtool to maintain a longterm data-store and to draw pretty graphs, giving up to the minute information on the state of each network connection.

SmokePing uses latency measurement plug-ins for seamless extendability.


Smart Alarms

SmokePing comes with a smart alarm system. Apart from simple threshold alarms, you have the option of defining latency or loss patterns and use them to trigger alarms. This allows you to define a pattern which would generate a single alarm when the loss goes from below 1% to over 20% and stays over 20% for more than 10 minutes. The advantage of this approach is the virtual elimination of duplicate alarms which you would get with a simple threshold based system.

Alarms can be sent to a mail address or a pager and if you want you can also start an external script to handle the alarms.

[1.] CentOS 4.4 Server CD 最小安裝

[2.] yum install gcc gcc-c++ freetype-devel libart_lgpl-devel libpng-devel libidn-devel rpm-build

[3.] rrdtool-1.2.23
./configure && make && make install

[4.] fping-2.4b2_to
wget http://fping.sourceforge.net/download/fping.tar.gz
./configure && make && make install

[5.] echoping-5.2.0
./configure && make && make install

on fedora 6 可以 yum install rrdtool fping echoping

[6.] curl
yum install curl

[7.] perl 模組
yum install perl-Net-Telnet perl-Net-DNS perl-LDAP perl-IO-Socket-SSL

由於 Authen::Radius用 yum找不到,只好執行 cpan,第一次使用就只要一直Enter就好,最後需要選擇 Asia及Taiwan,再來選擇下載點,
在提示符號為cpan> 下輸入 install Authen::Radius,還要 install CGI::Carp

[8.] CGI-SpeedyCGI-2.22
wget http://search.cpan.org/CPAN/authors/id/H/HO/HORROCKS/CGI-SpeedyCGI-2.22.tar.gz
perl Makefile.PL
Compile mod_speedycgi (default no)? no
make
make test
make install

[9.] Apache
yum install httpd

[10.] smokeping-2.1.1 解壓、檔案目錄相關設定
tar zxvf smokeping-2.1.1.tar.gz
mv smokeping-2.1.1 /usr/local/smokeping
chown -R root.root /usr/local/smokeping
cp /usr/local/smokeping/bin/smokeping.dist /usr/local/smokeping/bin/smokeping
cp /usr/local/smokeping/bin/tSmoke.dist /usr/local/smokeping/bin/tSmoke
cp /usr/local/smokeping/etc/basepage.html.dist /usr/local/smokeping/etc/basepage.html
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
cp /usr/local/smokeping/etc/smokemail.dist /usr/local/smokeping/etc/smokemail
cp /usr/local/smokeping/etc/tmail.dist /usr/local/smokeping/etc/tmail
cp /usr/local/smokeping/etc/smokeping_secrets.dist /usr/local/smokeping/etc/smokeping_secrets
cp /usr/local/smokeping/htdocs/smokeping.cgi.dist /usr/local/smokeping/htdocs/smokeping.cgi
mkdir /usr/local/smokeping/var /usr/local/smokeping/img
chown apache.apache /usr/local/smokeping/img
cp /usr/local/smokeping/htdocs/smokeping.cgi /var/www/cgi-bin/
ln -s /usr/local/smokeping/img/ /var/www/html/smokeping

[11.] 設定 smokeping
vi /usr/local/smokeping/etc/config

*** General ***

owner    = Cross
contact  = cross@ssorc.tw
mailhost = localhost
sendmail = /usr/lib/sendmail
imgcache = /usr/local/smokeping/img
imgurl   = http://ssorc.tw/smokeping
datadir  = /usr/local/smokeping/var
piddir  = /usr/local/smokeping/var
cgiurl   = http://ssorc.tw/cgi-bin/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail

tmail = /usr/local/smokeping/etc/tmail

*** Alerts ***
to = cross@ssorc.tw
from = smokeping@ssorc..tw

*** Presentation ***

template = /usr/local/smokeping/etc/basepage.html

*** Probes ***

+ FPing

binary = /usr/sbin/fping

*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets

vi /var/www/cgi-bin/smokeping.cgi

#!/usr/bin/speedy -w
# -*-perl-*-
# 指引到有 RRDp.pm 檔的路徑

use lib qw(/usr/local/rrdtool-1.2.23/lib/perl/5.8.5/);
use lib qw(/usr/local/smokeping/lib);
use CGI::Carp qw(fatalsToBrowser);

use Smokeping 2.001001;

Smokeping::cgi("/usr/local/smokeping/etc/config");

vi /usr/local/smokeping/bin/smokeping

#!/usr/bin/perl -w
# -*-perl-*-

use lib qw(/usr/local/rrdtool-1.2.23/lib/perl/5.8.5/);
use lib qw(/usr/local/smokeping/lib/);

use Smokeping 2.001001;

Smokeping::main("/usr/local/smokeping/etc/config");

[12.] 測試 config
/usr/local/smokeping/bin/smokeping –check

Configuration file '/usr/local/smokeping/etc/config' syntax OK.

[13.] 啟動
/usr/local/smokeping/bin/smokeping

[14.] 瀏覽
http://ssorc.tw/cgi-bin/smokeping.cgi

[15.] 新增 Host,(原config裡已有一些 Host,不過可以拿掉)
vi /usr/local/smokeping/etc/config

+ SSORC

menu = ssorc.tw
title = ssorc.tw

++ Hinet

menu = Hinet
title = 黑 Net

+++ WWW

menu = www
title = www.hinet.net
host = www.hinet.net

+++ DNS

menu = dns
title = dns.hinet.net
host = dns.hinet.net

安裝可參考
http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html
http://blog.yam.com/ystuan/article/6048296
http://www.mw.net.tw/user/lindahu/blog/2005/04/26/1502/5187/

config檔參數可參考
http://oss.oetiker.ch/smokeping/doc/smokeping_config.en.html

其它參考
http://oss.oetiker.ch/smokeping/doc/index.en.html
http://www.mw.net.tw/user/lindahu/blog/2007/03/28/1502/53193/
 

最後修改日期: 2007 年 06 月 14 日

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。