2013/06/04

前不久安裝了smokeping
補一下監控的部分
先裝上mail client
apt-get install mailutils

#vi /etc/smokeping/config.d/Alerts

*** Alerts ***
to = derek@faq-book.com   #設定要收到警報信件的信箱
from = faq@faq-book.com   #設定本機發信的帳號
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

以下為範例

+lossdetect
 type = loss
 # in percent
 pattern = ==0%,==0%,==0%,==0%,>20%,>20%,>20%
 comment =
#說明 : 這是用來偵測突然間loss封包
 +miniloss
 type = loss
 # in percent
 pattern = >0%,*4*,>0%,*4*,>0%
 comment =
#說明 : 當連續兩個週期封包都有loss 4個或高於0%,且在第三個週期封包高於0 %的話就alert
+someloss
 type = loss
 # in percent
 pattern = >20%,>20%
 comment =
#說明 : 當連續兩個週期封包都Loss高於20% 時就alert
 +rttdetect
 type = rtt
 # in milliseconds
 pattern = <10,<10,<10,<10,<10,<100,>100,>100,>100
 comment =
#說明: 如果當前5次延遲小於10 ms,第6次小於100 ms而從第7次開始連續三次都高於100 ms的話就alert
 +rttbadstart
 type = rtt
 # in milliseconds
 pattern = >4.5,>4.5
 comment =
#說明 : 在連續兩個週期內ping值平均都高於4.5 ms時就alert

接下來要在/etc/smokeping/config.d/Targets裡
每一個要監控的device最後加上

alerts = lossdetect,miniloss  <------  加入所需要的監控條件

service smokeping restart

http://ithelp.ithome.com.tw/question/10076486

沒有留言: