最近在外网新搭了一套nagios系统,开始几天系统出了问题nagios还能发邮件通知,可最近出了问题老收不到邮件,手工在服务器上发邮件又可以,后来一查sendmail的日志和nagios的日志,发现sendmail的邮件只有邮件信息,没有进邮件队列.nagios那边的日志又报下面的警告:


[1380202463] HOST NOTIFICATION: nagios;wensan_monitor_test_x.x;DOWN;host-notify-by-email;CRITICAL - Bogus ICMP: Port Unreachable (192.168.x.x)
[1380202473] HOST NOTIFICATION: kevin01.wang;wensan_monitor_test_x.x;DOWN;host-notify-by-email;CRITICAL - Bogus ICMP: Port Unreachable (192.168.x.x)
[1380202504] Warning: Contact 'xx.xx' host notification command '/usr/bin/printf "%b" "***** centreon Notification *****\n\nType:PROBLEM\nHost: wensan_monitor_test_x.x\nState: DOWN\nAddress: 192.168.x.x\nInfo: CRITICAL - Bogus ICMP: Port Unreachable (192.168.x.x)\nDate/Time: 26-09-2013" | /bin/mail -s "Host DOWN alert for wensan_monitor_test_x.xx!" xx@xx' timed out after 30 seconds


从上面的日志看,应该是发送超时了,也就是说设置的通知时间还不够能让sendmail发出邮件的时间,到这就好办了.通过修改nagios的配置文件nagios.cfg,将notification_timeout=30改为notification_timeout=120后重起nagios.发现已经能收到报警邮件了,到此问题解决!