Monitoring 使用Nagios监视远程服务器

Monitoring 使用Nagios监视远程服务器,monitoring,remote-server,nagios,Monitoring,Remote Server,Nagios,我试图检查一些设备的状态,但Nagios服务器无法提供这些设备。因此,我尝试将其他服务器与NSClient++一起使用。因此,我在Nagios上创建了文件/etc/configs/templates.cfg,内容如下: define command{ command_name check-host-alive-dpi command_line $USER1$/check_nrpe -H 192.168.112.12 -c remote_ping -a

我试图检查一些设备的状态,但Nagios服务器无法提供这些设备。因此,我尝试将其他服务器与NSClient++一起使用。因此,我在Nagios上创建了文件
/etc/configs/templates.cfg
,内容如下:

define command{
        command_name    check-host-alive-dpi
        command_line    $USER1$/check_nrpe -H 192.168.112.12 -c remote_ping -a $HOSTADDRESS$
        }


define host{
    name                    DPI ; The name of this host template
    use                     generic-host    ; This template inherits other values from the generic-host template
    check_period            24x7        ; By default, Linux hosts are checked round the clock
    check_interval          5       ; Actively check the host every 5 minutes
    retry_interval          1       ; Schedule host check retries at 1 minute intervals
    max_check_attempts      10      ; Check each Linux host 10 times (max)
    check_command           check-host-alive-dpi ; Default command to check Linux hosts
    notification_period     24x7
    notification_interval   120     ; Resend notifications every 2 hours
    notification_options    d,u,r       ; Only send notifications for specific host states
    #contact_groups         admins,zikit        ; Notifications get sent to the admins by default
    hostgroups              przystanki
    register                0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
    }
接下来,我在
/servers/DPI.cfg
文件中定义了主机,如下所示:

   define host{
    use     DPI
    host_name   cc01
    alias       cc01, ethernet
    address     172.18.5.85
    parents     KRKttl01
    }

define host{
    use     DPI
    host_name   cc02
    alias       cc02, ethernet
    address     172.18.5.86
    parents     KRKttl01
    }

define host{
    use     DPI
    host_name   cc03
    alias       cc03, ethernet
    address     10.0.54.16
    parents     KRKttl01
    }
当我重新启动Nagios时,它无法启动。它说:

Failed to start LSB:starts and stops the Nagios monitoring server.
我没有更改/创建任何其他文件。
提前感谢。

您可以在nagios.log中找到什么?另外,在通过
Nagios-v/path/to/main/Nagios/config.cfg
重新启动Nagios服务器之前,请尝试运行配置检查。现在没事了,存在重复的主机,这是原因之一。谢谢你的承诺。