排除Nagios警报故障 又名。 为什么我的警报没有发射?

我正在尝试将电子邮件警报添加到现有的Nagios安装中。 我一直在使用Web界面来关注一些非关键系统几个月,并且运行良好; 警告和关键问题被发现没有问题。

我的下一个步骤是启用警报function,但即使摆弄了几个小时,我仍然无法获得最简单的警报。 对于可能出现什么问题,我完全没有想法。 这几乎肯定是一件简单的事情,我只是没有接受,所以希望你们中的一个能轻松地发现。

我正在testing的命令很简单。 最初我只是想写一个文件:

define command{ command_name alerter command_line echo "Alerter command fired by Nagios" >> /usr/local/nagios/var/alerter.log } 

我已经testing了nagios用户可以使用sudo执行这个命令。 一切似乎都好。

主机和服务都是指“pipe理员”联系人组。 这些是他们使用的模板,他们都没有覆盖任何这些设置。

 define host{ name generic-host notifications_enabled 1 event_handler_enabled 1 flap_detection_enabled 1 failure_prediction_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 check_period 24x7 check_interval 1 retry_interval 1 max_check_attempts 10 check_command check-host-alive notification_period 24x7 notification_interval 120 notification_options d,u,r,s,f contact_groups admins register 0 } define service{ name generic-service active_checks_enabled 1 passive_checks_enabled 1 parallelize_check 1 obsess_over_service 1 check_freshness 0 notifications_enabled 1 event_handler_enabled 1 flap_detection_enabled 1 failure_prediction_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 is_volatile 0 check_period 24x7 max_check_attempts 3 normal_check_interval 1 retry_check_interval 1 contact_groups admins notification_options w,u,c,r notification_interval 120 notification_period 24x7 register 0 } 

联系人和联系人组configuration如下:

 define contact{ name generic-contact service_notification_period 24x7 host_notification_period 24x7 service_notification_options w,u,c,r,f,s host_notification_options d,u,r,f,s service_notification_commands alerter host_notification_commands alerter register 0 } define contact{ contact_name nagiosadmin use generic-contact alias Nagios Admin email [email protected] } define contactgroup{ contactgroup_name admins alias Nagios Administrators members nagiosadmin } 

当我发生停机事件时,Nagios把它捡起来并logging下来。

 [1315210448] SERVICE ALERT: ifs.aleph;Test service;CRITICAL;HARD;3;HTTP CRITICAL: HTTP/1.1 400 Bad Request - string 'Blah blah' not found on 'http://aleph.tekretic.com.au:80/' - 168 bytes in 0.369 second response time [1315210653] SERVICE ALERT: ifs.aleph;Test service;OK;HARD;3;HTTP OK: HTTP/1.1 200 OK - 416 bytes in 0.364 second response time 

..但没有logging到我的'alerter.log'文件。 就好像alerter命令永远不会被触发。

我在想什么?

确保在nagios.cfg有以下nagios.cfg

 log_notifications=1 enable_notifications=1 

也尝试增加debug_level到32通知看看它说什么:

 debug_level=32