Nagios не выполняет внешние команды, даже если они отображаются в журналах

Я хочу использовать ловушки SNMP, и для этого мне нужно выполнить внешние команды nagios.

Я уже проверил конфигурацию:

check_external_commands=1
command_check_interval=-1

Командный файл доступный.

Когда я отправляю внешнюю команду в nagios, команда отображается в журналах, но кажется, что она не выполняется. Итак, я попытался установить результат пассивной проверки в веб-интерфейсе (отправить результат пассивной проверки ...). Журнал показывает:

[1484062350] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;server11;RAID-Array;1;Testing| 

Ничего не происходит.

Определение службы:

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                  netops-24x7       ; Modify this to match your Nagios contact group definitions
register                        0
}

define service {
use             SNMP_TRAP
host_name               server11
service_description RAID-Array
check_interval      120 ; Don't clear for 2 hours
}
0
задан 11 January 2017 в 11:45
1 ответ

يمكنك التحقق من الملف الذي يحتوي على كافة الأوامر الخارجية التي يجب تنفيذها بواسطة nagios:

tail -f /usr/local/nagios/var/rw/nagios.cmd

علاوة على ذلك ، يمكنك اختبار الأمر محليًا إذا كتبت مباشرة في هذا الملف بالصيغة التالية:

echo [timestamp] PROCESS_SERVICE_CHECK_RESULT;server11;RAID-Array;1;Testing >> /usr/local/nagios/var/rw/nagios.cmd

تأكد من:

  • الطابع الزمني الذي ترسله إلى nagios هو نفس تاريخ الخادم الخاص بك.
  • اسم مضيفك ،
  • اسم خدمتك وهذه الخدمة أعلن في مضيفك
0
ответ дан 24 November 2019 в 05:07

Теги

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