Почему мои пассивные проверки не обрабатываются?

У меня есть следующая сервисная конфигурация для получения прерываний SNMP:

define service {
    name                            SNMP_TRAP
    service_description             SNMP_TRAP
    active_checks_enabled           1       ; Active service checks are enabled
    passive_checks_enabled          1       ; Passive service checks are enabled/accepted
    parallelize_check               1       ; Active service checks should be parallelized
    process_perf_data               0
    obsess_over_service             0       ; We should obsess over this service (if necessary)
    check_freshness                 0       ; Default is to NOT check service 'freshness'
    notifications_enabled           1       ; Service notifications are enabled
    event_handler_enabled           1       ; Service event handler is enabled
    flap_detection_enabled          1       ; Flap detection is enabled
    process_perf_data               1       ; Process performance data
    retain_status_information       1       ; Retain status information across program restarts
    retain_nonstatus_information    1       ; Retain non-status information across program restarts
    check_command                   check-host-alive      ; This will be used to reset the service to "OK"
    is_volatile                     1
    check_period                    24x7
    max_check_attempts              1
    normal_check_interval           1
    retry_check_interval            1
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r
    contact_groups                  admins
    register                        0
}

define service {
    use                     SNMP_TRAP
    service_description     gigabitethernet16
    hostgroup_name          cisco
    check_interval          120
}

У меня есть несколько устройств в cisco группа, например:

define host {
    use                     base-host
    host_name               cisco-sg300-28-4
    alias                   CISCO-SG300-28 (VT-Registratur)
    display_name            Switch VT-Registratur
    address                 10.0.1.109
    hostgroups              switches,cisco,cisco28
}

Сервис появляется очень хорошо в веб-интерфейсе:

enter image description here

Однако полученные сервисные чеки не обрабатываются вообще. Мой /var/lib/nagios3/rw/nagios.cmd файл собирает результаты, но файл никогда не очищается, и результаты не появляются в Nagios. nagios.cmd содержит, например:

[1437659629] PROCESS_SERVICE_CHECK_RESULT;cisco-sg300-28-4;gigabitethernet16;2;gigabitethernet16 linkDown

accept_passive_service_checks во включают nagios.cfg.

После дальнейшего контроля я понял это nagios.cmd как предполагается, именованный канал. В моем случае это - справедливое простой файл:

enter image description here

Из нашего архива журнала я вижу, что пассивные проверки были обработаны в какой-то момент в прошлом, но теперь они больше не работают.

1
задан 24 July 2015 в 11:18
1 ответ

Я снова смотрел конфигурацию, чтобы найти более подробную информацию для nagios.cmd , и нашел это:

# EXTERNAL COMMAND FILE
# This is the file that Nagios checks for external command requests.
# It is also where the command CGI will write commands that are submitted
# by users, so it must be writeable by the user that the web server
# is running as (usually 'nobody').  Permissions should be set at the
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.
# Debian Users: In case you didn't read README.Debian yet, _NOW_ is the
# time to do it.

command_file=/var/lib/nagios3/rw/nagios.cmd

Итак, это дало мне идею взглянуть на README.Debian , который находится по адресу /usr/share/doc/nagios3-common/README.Debian и содержит следующую инструкцию:

- activate external command checks in the nagios configuration. this
  can be done by setting check_external_commands=1 in the file
  /etc/nagios3/nagios.cfg.

Хотя я был уверен, что эта директива включена , Я дважды проверил, и на самом деле он не был включен.

После включения (и выполнения других задач, упомянутых в README , именованный канал был создан.

]
1
ответ дан 4 December 2019 в 00:03

Теги

Похожие вопросы