您好,登錄后才能下訂單哦!
本篇內容介紹了“如何安裝配置Smokeping”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
Smokeping 是一款用于網絡性能監測的監控軟件,通過它可以在自己公司IDC的網絡狀況,如延時,丟包率,是否BGP多線等,通過rrdtool制圖方式,圖形化地展示網絡的時延情況,進而能夠清楚的判斷出網絡的即時通信情況
一.安裝軟件
1.使用yum 命令安裝所需的工具 (依賴包好多)
yum install gcc freetype-devel zlib-devel libpng-devel libart_lgpl-devel httpd-devel apr-util-devel apr-devel cairo cairo-devel pango pango-devel libxml2 libxml2-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC
2. 安裝rrdtool
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.6.tar.gz
tar zxvf rrdtool-1.3.6.tar.gz
cd rrdtool-1.3.6
./configure --disable-tcl
make
make install
3. 安裝cgilib
wget http://down1.chinaunix.net/distfiles/cgilib-0.5.tar.gz
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make
cp libcgi.a /usr/local/lib
cp cgi.h /usr/include
4. 安裝fping
wget http://fping.sourceforge.net/download/fping.tar.gz
tar zxvf fping.tar.gz
cd fping-2.4b2_to
./configure
make
make check
make install
5.安裝 echoping
wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.0/echoping-6.0.0.tar.gz
tar zxvf echoping-6.0.0.tar.gz
cd echoping-6.0.0
./configure
make
make test
make install
6.安裝 CGI-SpeedyCGI
wget ftp://195.220.108.108/linux/epel/5/x86_64/mod_speedycgi-2.22-4.el5.x86_64.rpm
wget ftp://ftp.muug.mb.ca/mirror/fedora/epel/5/x86_64/perl-CGI-SpeedyCGI-2.22-4.el5.x86_64.rpm
rpm -ivh --force perl-CGI-SpeedyCGI-2.22-4.el5.x86_64.rpm
rpm -ivh mod_speedycgi-2.22-4.el5.x86_64.rpm
wget http://mirrors.163.com/cpan/authors/id/H/HO/HORROCKS/CGI-SpeedyCGI-2.22.tar.gz
tar zxvf CGI-SpeedyCGI-2.22.tar.gz
cd CGI-SpeedyCGI-2.22
perl Makefile.PL
遇到問題選擇默認選項(no)
make
make test
make install
7.安裝smokeping
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.3.6.tar.gz
tar zxvf smokeping-2.3.6.tar.gz
mv smokeping-2.3.6 /usr/local/smokeping
cd /usr/local/smokeping
二.配置smokeping
1. 修改文件名
修改/usr/local/smokeping/bin下的smokeping.dist
cp smokeping.dist smokeping
修改etc/ 下的 basepage.html.dist,config.dist,smokemail.dist
cp basepage.html.dist basepage.html
cp config.dist config
cp smokemail.dist smokemail
chmod 600 smokeping_secrets.dist
修改htdoc/下的smokeping.cgi.dist
cp smokeping.cgi.dist smokeping.cgi
2. 修改配置文件
配置 bin/smokeping
vi /usr/local/smokeping/bin/smokeping
在這個文件里面我們需要修改前面兩個 lib 和后面 config 文件的 path。
兩個 lib 分別是 smokeping 的 lib 和 rrdtool 的 lib (紅色為修改后的內容)
#!/usr/sepp/bin/perl-5.8.4 -w
#!/usr/bin/perl -w
use lib qw(/usr/pack/rrdtool-1.2.23-mo/lib/perl);
use lib qw(/usr/local/rrdtool-1.3.6/lib/perl);
use lib qw(lib);
use lib qw(/usr/local/smokeping/lib);
use Smokeping 2.003006;
Smokeping::main("etc/config.dist");
Smokeping::main("/usr/local/smokeping/etc/config");
配置 htdocs/smokeping.cgi,方法與上面相同
vi /usr/local/smokeping/htdocs/smokeping.cgi
************************
#!/usr/sepp/bin/speedy -w
#-*-perl-*-
#!/usr/bin/speedy -w
# -*-perl-*-
# use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
use lib qw(/usr/local/rrdtool-1.3.6/lib/perl/);
# use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
use lib qw(usr/local/smokeping//lib);
use Smokeping 2.003006;
Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config");
Smokeping::cgi("/usr/local/smokeping/etc/config");
配置 etc/config
vi usr/local/smokeping/etc/config 將以下幾行替換為已經安裝的相關軟件的路徑
*** General ***
imgcache = /home/oetiker/public_html/smokeping-ms/cache
imgcache = /usr/local/smokeping/htdocs/cache
imgurl = cache
imgurl = cache
datadir = /tmp/smokeping-ms/data
datadir = /usr/local/smokeping/var
piddir = /tmp/smokeping-ms/var
piddir = /usr/local/smokeping/var
cgiurl = http://some.url/smokeping.cgi
cgiurl = http://本機IP/htdocs/smokeping.cgi ;
smokemail = /home/oetiker/checkouts/smokeping/trunk/software/etc/smokemail.dist
smokemail = /usr/local/smokeping/etc/smokemail
tmail = /home/oetiker/checkouts/smokeping/trunk/software/etc/tmail.dist
tmail = /usr/local/smokeping/etc/tmail.dist
*** Presentation ***
template= /home/oetiker/checkouts/smokeping/trunk/software/etc/basepage.html.dist
template = /usr/local/smokeping-2.3.6/etc/basepage.html
*** Probes ***
+ FPing
binary = /usr/sbin/fping
binary = /usr/local/sbin/fping
#** Database ***
step = 60
pings = 10
修改ping的頻率,默認為300秒ping20 次,我們可以根據需要調整,這里修改為60秒 ping 10次。
*** Targets ***
#=================================
#這里用于配置監控目標,以+號分層,+為首頁,++為子層,我們以百度和搜狐為例。
+TEST
menu= TEST
title = TEST
++ baidu
menu = baidu
title = baidu
host = 115.239.210.27
++ sohu
menu = sohu
title = sohu
host = 121.14.0.97
#=================================
3. 添加目錄
建立下面三個目錄用于保存smokeping的數據等
mkdir /usr/local/smokeping/data
mkdir /usr/local/smokeping/var
mkdir /usr/local/smokeping/htdocs/cache
chown –R apache:apache /usr/local/smokeping
4. 修改apache配置文件
vi /etc/httpd/conf/httpd.conf
添加下面內容:
Alias /smokeping/ "/usr/local/smokeping/htdocs/"
Alias /cache/ "/usr/local/smokeping/cache/"
<Directory "/usr/local/smokeping/htdocs">
Options FollowSymLinks ExecCGI
AllowOverride None
AddHandler cgi-script cgi
Order allow,deny
Allow from all
</Directory>
三.啟動
1.重啟apache
service httpd restart
2.重啟smokeping
/usr/local/smokeping/bin/smokeping restart
完成。
“如何安裝配置Smokeping”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。