2015-12-08 29 views
0

我在設置nagios依賴關係時遇到困難,因此我只在主機啓動(Pingable)時收到通知。設置Nagios依賴關係來監視Windows主機上的服務

我的主人CFG文件是如下:

# Configuration file /etc/nagios/adagios/hosts/dp-front.cfg 
# Edited by PyNag on Wed Nov 11 16:38:15 2015 

define host { 
     alias       Ditmas Park Front Desk 
     use       windows-server 
     host_name      dp-front 
     address      192.168.200.47 
     max_check_attempts   2 
     check_command     check-host-alive 
     check_period     workhours 
     notification_period   workhours 
} 

define service{ 
     use      generic-service 
     host_name    dp-front 
     service_description  Medical Records 
     check_command   check_nt!PROCSTATE!-d SHOWALL -l Robocopy.exe 
     notification_interval   0 
     max_check_attempts   1 
     } 

define servicedependency{ 
       host_name      localhost 
       service_description    PING 
       dependent_host_name    localhost 
       dependent_service_description PING 
       execution_failure_criteria  c 
       notification_failure_criteria w,u,c 

       } 

Nagios是正確監控的服務,我收到通知,所有的時間當服務下去。我只是不知道如何設置它的「servicedependency」部分。

我會非常感謝你一如既往的幫助。

回答

0

也許你需要下面perameter設置在主機配置文件

notification_options杜爾

+0

它已經建立 'execution_failure_criteria U,C,P' 'notification_failure_criteria U,C,P' –

0

添加到您的主機模板'windows-server'一個notification_option選項

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectdefinitions.html

notification_options:該指令用於確定wh應發送主機通知給 。有效選項是 以下一項或多項的組合:d = 發送通知DOWN狀態,u =發送UNREACHABLE狀態通知,r =發送 恢復通知(OK狀態),f =發送通知 主機啓動和停止振盪,s = 計劃停機時間開始和結束時發送通知。如果您將n(無)指定爲 選項,則不會發送主機通知。如果您沒有指定 任何通知選項,則Nagios將假定您想要發送 通知以獲得所有可能的狀態。例如:如果您在此字段中指定了d,r,則只有當主機變爲DOWN並從DOWN狀態恢復時,纔會發送通知 。