使用Nagios监控远程服务器

时间:2017-07-18 13:38:22

标签: 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 $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.

我没有更改/创建任何其他文件。 提前谢谢。

0 个答案:

没有答案