email notice problem

Andy Shellam (Mailing Lists) andy.shellam-lists at mailnetwork.co.uk
Fri Feb 16 17:00:20 CET 2007


admin at lctn.org wrote:
>> 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!"
>> admin at domain.com"
>>
>> 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!"
>> admin at domain.com"
>>
>>
>> Looks like a copy and paste error. Oh and you probably also want to use
>> something other than your 'admin at lctn' account. It's like sending from
>> root at localhost.localdomain :P
>>     
>
>
> 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!" admin at lctn.org" 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.
>
>
>   

If you "su" to the Nagios user, and just run "mail" - does it yield 
anything, or "command not found"?

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.
You need to change your notification command to pipe the result to "mail 
-s ...." instead of " -s ..."

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.)

Andy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070216/e8899fbe/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list