email notice problem

Robert Smith lists at wansecurity.com
Fri Feb 16 16:34:22 CET 2007


>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"
> resulted in a return code of 127.  Make sure the script or binary you are
> trying to execute actually exists...
>


There is a quoting error causing your problem. Check your command definition for 
host-notify-by-email.

try something like:

define command {
                command_name                    host-notify-by-email
                command_line                    echo "***** Nagios *****\n\nNotification Type:$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"  | mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" "$CONTACTEMAIL$"
}

The command line should be all one line and contain exactly 4 double quotes ("). Also if you see yen symbols instead of backslashes, then you should replace those with backslashes.

-Robert Smith



Andy Shellam (Mailing Lists) wrote:
> admin at lctn.org wrote:
>> I am running 2.7 on an Ubuntu server, with sendmail. I have read the docs,
>> but am having trouble here. According to the examples given I have "define
>> contact" set up correctly. I also have an alias "nagiosadmin" in
>> /etc/aliases. Here is my config, and the error I am getting below. The
>> error is occuring when it reaches the "email" line. Any ideas how to
>> resolve this?
>>   
>
> Not sure if this directly relates to your problem, but you don't need 
> "nagiosadmin" in your aliases file, as the e-mail address that will be 
> delivered to is "admin at domain.com", and the e-mail will come "from" your 
> Nagios shell user at your machine domain (e.g. nagios at nagiosserver.domain.com)
>
> How do you know the error is at the "email" line?
> If "/path/to/nagios/bin/nagios -v /path/to/nagios.cfg" (substitute paths 
> as required) reports your configuration is correct, then the problem 
> more than likely lies within your command definitions.
>
> Andy.
>> define contact{
>>         contact_name                    nagiosadmin
>>         alias                           Nagios Admin
>>         service_notification_period     24x7
>>         host_notification_period        24x7
>>         service_notification_options    w,u,c,r
>>         host_notification_options       d,r
>>         service_notification_commands   notify-by-email
>>         host_notification_commands      host-notify-by-email
>>         email                           admin at domain.com
>>         }
>>
>>
>>
>>
>>
>>
>>
>> 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"
>> resulted in a return code of 127.  Make sure the script or binary you are
>> trying to execute actually exists...
>>
>>
>>   
>
>
> -------------------------------------------------------------------------
> 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
> _______________________________________________
> 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


-------------------------------------------------------------------------
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
_______________________________________________
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