<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="mailto:admin@lctn.org">admin@lctn.org</a> wrote:
<blockquote cite="mid1944.64.8.148.4.1171640591.squirrel@lctn.org"
type="cite">
<blockquote type="cite">
<pre wrap="">That looks fine to me. The problem is in your host-notify-by-email
definition in the misccommands.cfg file. If you look below you have;
sterilizing
Host Unreachable (10.10.4.89)\n\nDate/Time: Fri Feb 16 09:10:01 CST
> 2007\n" | -s "Host DOWN alert for relay-1.domain.com!"
<a class="moz-txt-link-abbreviated" href="mailto:admin@domain.com">admin@domain.com</a>"
Where it should read;
> Host Unreachable (10.10.4.89)\n\nDate/Time: Fri Feb 16 09:10:01 CST
> 2007\n" | mail -s "Host DOWN alert for relay-1.domain.com!"
<a class="moz-txt-link-abbreviated" href="mailto:admin@domain.com">admin@domain.com</a>"
Looks like a copy and paste error. Oh and you probably also want to use
something other than your 'admin@lctn' account. It's like sending from
<a class="moz-txt-link-abbreviated" href="mailto:root@localhost.localdomain">root@localhost.localdomain</a> :P
</pre>
</blockquote>
<pre wrap=""><!---->
Sorry about that... I was sterolizing the error. Here is exactly what the
error says.
[1171638601] HOST NOTIFICATION:
nagiosadmin;relay-1.lctn.org;DOWN;host-notify-by-email;CRITICAL - Host
Unreachable (10.10.4.89)
[1171638601] Warning: Attempting to execute the command "/usr/bin/printf
"%b" "***** Nagios 2.7 *****\n\nNotification Type: PROBLEM\nHost:
relay-1.lctn.org\nState: DOWN\nAddress: 10.10.4.89\nInfo: CRITICAL - Host
Unreachable (10.10.4.89)\n\nDate/Time: Fri Feb 16 09:10:01 CST 2007\n" |
-s "Host DOWN alert for relay-1.lctn.org!" <a class="moz-txt-link-abbreviated" href="mailto:admin@lctn.org">admin@lctn.org</a>" resulted in a
return code of 127. Make sure the script or binary you are trying to
execute actually exists...
I do not have a misccommands.cfg, but I do have commands.cfg.
using the "mail" command yields nothing, but as I mentioned, I do have
sendmail installed. I can telnet to localhost on port 25.
The reason I suspected it stops at "email", is that if I change the
contact email, it shows up in the log file with the same error.
</pre>
</blockquote>
<br>
If you "su" to the Nagios user, and just run "mail" - does it yield
anything, or "command not found"?<br>
<br>
The error seems to be (as someone previously said) it's piping your
notification text to " -s "Host DOWN..."" which isn't a valid command.<br>
You need to change your notification command to pipe the result to
"mail -s ...." instead of " -s ..."<br>
<br>
You may also need to try "sendmail" (I don't use sendmail so I don't
know if "mail" is part of it or not.)<br>
<br>
Andy.<br>
<br>
</body>
</html>