设置Nagios依赖项以监视Windows主机上的服务

时间:2015-12-08 20:09:53

标签: windows service dependencies nagios

我在设置nagios依赖项时遇到了困难,因此我只在主机启动时收到通知(Pingable)。

我的主机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"部分。

我一如既往地非常感谢你的帮助。

2 个答案:

答案 0 :(得分:0)

您可能需要在主机配置文件中设置以下参数

notification_options d u r

答案 1 :(得分:0)

添加到主机模板'windows-server' notification_option选项

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

  

notification_options:此指令用于确定何时   应发送主机通知。有效选项是a   以下一项或多项的组合:d =发送通知   在DOWN状态下,u =在UNREACHABLE状态下发送通知,r =发送   关于恢复的通知(OK状态),f =何时发送通知   主机启动和停止振荡,s =发送通知时   计划停机时间开始和结束。如果指定n(无)作为   选项,不会发送主机通知。如果你没有指定   任何通知选项,Nagios都会假设您想要   要发送给所有可能状态的通知。示例:如果你   在此字段中指定d,r,通知仅在发送时发送   主机变为DOWN,当它从DOWN状态恢复时。