讓Nagios服務檢查略過 Exchange2000 DB Maintain Period

將 Exchange2000 轉到 Proxmox 後,Nagios 一直都會在 exchange2000 db maintain 的時段報錯(time out)。為解決此一問題,決定讓 Nagios 略過exchange 資料庫維護期間的服務檢查。

所以在 naigos 的 timeperiod.cfg 設定檔,定義兩個時段的設定。定義週一到週日早上05:00~06:00時段這是要用來略過的時段,及Exchange2000服務檢查所要套用的時段(包含全時段設定,但不含要略過的時段)。

define timeperiod{
timeperiod_name exchange2000_db_maintain
alias exchange2000 db maintain periods

sunday 05:00-06:00
monday 05:00-06:00
tuesday 05:00-06:00
wednesday 05:00-06:00
thursday 05:00-06:00
friday 05:00-06:00
saturday 05:00-06:00
}

define timeperiod{
timeperiod_name exchange2000_timeperiod
alias exchange2000 check timeperiod,exclude 05:00-06:00 everydays.

sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00

exclude exchange2000_db_maintain ;
}

接著修改 Exchange2000 設定檔 define host 區塊 及 每個 define service 區塊 中加入 check_period 參數,指定檢查時間區段。

# Define a host for the local machine

define host{
use windows-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the freebsd-server host template definition.
check_period exchange2000_timeperiod
host_name mail2
alias mail2
address 192.168.128.251
}

# Define a service to CPU on the remote machine.

define service{
use local-service
check_period exchange2000_timeperiod
host_name mail2
service_description CPU load
check_command CheckCPU!80!90
}

最後就是讓 Nagios 服務重新載入新的設定囉!

/usr/local/etc/rc.d/nagios reload

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s