网络通信 频道

FreeBSD:解决Nagios不发报警短信的问题

nagios自己也有日志记录

  查去查来,找不到头绪。再查sendmail 的日志/var/log/maillog,只发现我手动发送邮件的记录,而没有其他发送记录---只有下面这么一条记录:

  Jul 27 14:27:48 nagios sm-mta[37141]: m6RERkYR037139: to=<sery@163.com>, ctladdr=<nagios@nagios.sery.com> (1003/1003), delay=00:00:02, xdelay=00:00:01, mailer=esmtp, pri=30623, relay=163mx02.mxmail.netease.com. [220.181.12.66], dsn=2.0.0, stat=Sent (Mail OK queued as mx16,QsCowLDbPSxWFYxIb6TzGw==.27600S2 1217140055)看来nagios并没有调用sendmail发送邮件。

  差点忘了,nagios自己也有日志记录呢!赶快打开看一眼,发现里面有不少Warning,抽一个出来,其内容如下:

  [1217166816] HOST NOTIFICATION: sery;mail-server;DOWN;host-notify-by-email;CRITICAL - Plugin timed out after 10 seconds
  [1217166816] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios 2.9 *****\n\nNotification Type: PROBLEM\nHost: mail-server\nState: DOWN\nAddress: 211.155.115.66\nInfo: CRITICAL - Plugin timed out after 10 seconds\n\nDate/Time: Sun Jul 27 13:53:36 UTC 2008\n" | /bin/mail -s "Host DOWN alert for mail-server!" sery@163.com" resulted in a return code of 127.  Make sure the script or binary you are trying to execute actually exists...

0
相关文章