【问题标题】:Setup Nagios dependencies to monitor a service on a Windows host设置 Nagios 依赖项以监视 Windows 主机上的服务
【发布时间】:2015-12-08 20:09:53
【问题描述】:

我在设置 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 正在正确监控服务,并且当服务出现故障时,我一直都会收到通知。我只是不确定如何设置它的“服务依赖”部分。

非常感谢您一如既往的帮助。

【问题讨论】:

    标签: windows service dependencies nagios


    【解决方案1】:

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

    notification_options d u r

    【讨论】:

    • 已经设置 'execution_failure_criteria u,c,p' 'notification_failure_criteria u,c,p'
    【解决方案2】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-08
      • 1970-01-01
      • 2017-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多