溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

smokepin安裝及使用

發(fā)布時間:2020-07-18 05:44:05 來源:網(wǎng)絡(luò) 閱讀:1037 作者:qazplm59 欄目:網(wǎng)絡(luò)安全

1、基礎(chǔ)環(huán)境 yum安裝

yum -y install freetype freetype-devel libpng libpng-devel gd gd-devel libxml2 libxml2-devel

libiconv libiconv-devel pango pango-devel qpixman qpixman-devel glib glib-devel cairo cairo-devel libart* gettext gettext-devel libjpeg libjpeg-devel perl-XML-Simple.noarch perl-Crypt-SSLeay perl-Digest-HMAC

yum install httpd

yum install httpd-devel

yum install fping

2、安裝支持中文


yum -y install wqy-zenhei-fonts.noarch  “圖片中文顯示”


vim /usr/local/smokeping/lib/Smokeping/Graphs.pm  “在smokeping中修改”

my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],

后,添加 '--font TITLE:20:"WenQuanYi Zen Hei Mono"',


/usr/local/smokeping/etc/config “smokeping配置文件添加”

 

*** Presentation ***

charset = utf-8


3、安裝smokeping

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.2 /usr/local/smokeping

cd /usr/local/smokeping/

./configure --prefix=/usr/local/smokeping

報錯如下

** Aborting Configure ******************************

If you know where perl can find the missing modules, set
the PERL5LIB environment variable accordingly.

FIRST though, make sure that ‘perl’ starts the perl
binary you want to use for SmokePing.

Now you can install local copies of the missing modules
by running

./setup/build-perl-modules.sh /usr/local/thirdparty

The RRDs perl module is part of RRDtool. Either use the rrdtool
package provided by your OS or install rrdtool from source.
If you install from source, the RRDs module is located
PREFIX/lib/perl

根據(jù)提示,運行./setup/build-perl-modules.sh /usr/local/thirdparty
可以查看./setup/build-perl-modules.sh腳本內(nèi)容,發(fā)現(xiàn)其實就是在安裝smokeping所依賴的一些perl模塊

export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5/

./configure --prefix=/usr/local/smokeping

/usr/bin/gmake install


4、復(fù)制 所有帶*.dist

cd /usr/local/smokeping/etc

cp smokemail.dist smokemail

cp tmail.dist tmail

cp config.dist config

cd /usr/local/smokeping/htdocs

cp smokeping.fcgi.dist smokeping.fcgi

5、修改httpd.conf 配置文件


DocumentRoot "/var/www/html"

Alias /cache "/usr/local/smokeping/cache/"

Alias /cropper "/usr/local/smokeping/htdocs/cropper/"

Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"

<Directory "/usr/local/smokeping">

AllowOverride None

Options All

AddHandler cgi-script .fcgi .cgi

AllowOverride AuthConfig

Order allow,deny

Allow from all

AuthName "Smokeping"

AuthType Basic

AuthUserFile /usr/local/smokeping/htdocs/htpasswd

Require valid-user

DirectoryIndex smokeping.fcgi

</Directory>


6、修改 /usr/local/smokeping/etc/config

*** :標示的區(qū)塊屬于不同類型的內(nèi)容
+ :代表一級菜單 +下面的++是繼承上面的+成為二級菜單。 而且可以有多個一級菜單和二級菜單。

第一部分General區(qū)塊,屬于基本配置
owner = daemon smokeping運行的用戶
contact = admin@coocla.org smokeping管理員聯(lián)系郵件地址
mailhost = localhost 郵件服務(wù)器地址
sendmail = /usr/sbin/sendmail 發(fā)送郵件件的二進制可執(zhí)行程序
imgcache = /usr/local/smokeping/cache smokeping圖片緩存
imgurl = cache 定義cgi程序顯示圖片的url目錄
datadir = /usr/local/smokeping/data smokeping保存rrd文件的目錄
piddir = /usr/local/smokeping/var 顧名思義,其pid目錄
cgiurl = http://some.url/smokeping.cgi 完整的smokeping的url路徑
smokemail = /usr/local/smokeping/etc/smokemail.dist 發(fā)送郵件的郵件內(nèi)容模板
tmail = /usr/local/smokeping/etc/tmail.dist HTML郵件模板的路徑
syslogfacility = local0 syslog日志記錄的設(shè)備編號

第二部分Alter區(qū)塊,屬于報警配置
to = admin@coocla.org 報警郵件接收人地址
from = smokealert@company.xy 報警郵件發(fā)送人地址

+someloss 定義一個名為someloss的報警
type = loss 類型為丟包
pattern = >0%,*12*,>0%,*12*,>0% 對監(jiān)控內(nèi)容進行閥值的模式匹配
comment = loss 3 times in a row 檢測12次,出現(xiàn)了3次丟包的情況,不論丟多少個包,就進行報警

+70_rttbad

type = rtt

pattern = >70,>70,>70 # in milliseconds

comment = For more than three consecutive 70-millisecond delay.

#comment = rttbad表示連續(xù)3個包延遲超過70ms就發(fā)送報警


+80_rttbad

type = rtt

pattern = >80,>80,>80 # in milliseconds

comment = For more than three consecutive 80-millisecond delay.

#comment = rttbad表示連續(xù)3個包延遲超過80ms就發(fā)送報警


第三部分Database區(qū)塊,屬于RRDTOOL數(shù)據(jù)庫的配置
step = 300 步長,也就是多長時間為一個周期
pings = 20 ping的次數(shù),這兩項的組合意思是,每300秒進行20此的ping操作

# 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區(qū)塊,屬于網(wǎng)絡(luò)狀態(tài),web顯示的一些配置項
這塊還沒看,暫時先放這

第五部分Probes區(qū)塊,屬于Fping指針的配置
+ FPing
binary = /usr/sbin/fping

第六部分Slave區(qū)塊,屬于Matster,Slave架構(gòu)的配置
暫時先將其注釋起來,并連帶上下文中所涉及的項注釋下,否則待會啟動時會報錯

第七部分Targets區(qū)塊,屬于監(jiān)控目標的配置
probe = FPing 指定監(jiān)控指針

menu = Top 定義一個菜單,類型為Top,titile 注釋等信息,均可自定義
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 定義一個主機為James
menu = James 菜單名為James
title =James
alerts = someloss 報警閥值為上文定義的someloss
#slaves = boomer slave2
host = blog.coocla.org 監(jiān)控的主機blog.coocla.org

7、啟動smokeping httpd

chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

chown apache:apache  ../smokeping   -R  “允許apache讀取信息”

/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 “啟動smokeping”  

/usr/local/smokeping/bin/smokeping --reload “重新加載配置文件

8、首頁的集中顯示和報警的分別設(shè)置

以下實例 70_rttbad表示延遲23ms 80_rttbad表示延遲20ms


++ Dianxin

menu =電信網(wǎng)絡(luò)

title = 電信網(wǎng)絡(luò)

host = /moniter/Dianxin/dx1 /moniter/Dianxin/dx2

+++ dx1

menu = 電信網(wǎng)絡(luò) 140.205.203.152

title = 電信網(wǎng)絡(luò) 140.205.203.152

alerts = someloss,70_rttbad 

host = 140.205.203.152

+++ dx2

menu = 電信網(wǎng)絡(luò) 140.205.195.2

title = 電信網(wǎng)絡(luò) 140.205.195.2 

alerts = someloss,80_rttbad 

host = 1140.205.195.2


向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI