<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Nagios-users] notify with qmail and gentoo problem</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Here's my command form misc_commands.cfg:</FONT>
</P>

<P><FONT SIZE=2># 'notify-by-email' command definition</FONT>
<BR><FONT SIZE=2>define command {</FONT>
<BR>        <FONT SIZE=2>command_name    notify-by-email</FONT>
<BR>        <FONT SIZE=2>command_line    /usr/bin/printf "%b" "***** Nagios 1.0b6 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" |  -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$</FONT></P>

<P>        <FONT SIZE=2>}</FONT>
</P>

<P><FONT SIZE=2>I assumed this command was right and I just didn't know what was going on with the "| -s" part. It is possible that I didn't have my mail system installed and configured when I installed nagios (new box), so perhaps it didn't find any mail stuff and left parts of this command empty??? I'll try a new make install-config and see if I get anything interesting in misc_commands.cfg...</FONT></P>

<P><FONT SIZE=2>Lloyd</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Volker.Aust@premiere.de [<A HREF="mailto:Volker.Aust@premiere.de">mailto:Volker.Aust@premiere.de</A>]</FONT>
<BR><FONT SIZE=2>> Sent: Friday, October 25, 2002 8:25 AM</FONT>
<BR><FONT SIZE=2>> To: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> Cc: Meinholz@bmpcoe.org</FONT>
<BR><FONT SIZE=2>> Subject: RE: [Nagios-users] notify with qmail and gentoo problem</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Hi Lloyd,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > -----Original Message-----</FONT>
<BR><FONT SIZE=2>> > From: Lloyd Meinholz [<A HREF="mailto:Meinholz@bmpcoe.org">mailto:Meinholz@bmpcoe.org</A>]</FONT>
<BR><FONT SIZE=2>> > Sent: Friday, October 25, 2002 1:41 PM</FONT>
<BR><FONT SIZE=2>> > To: 'sancho@sancho2k.net'; nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> > Subject: RE: [Nagios-users] notify with qmail and gentoo problem</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> <snip></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > Since I got the following in nagios.log: </FONT>
<BR><FONT SIZE=2>> > [1035474094] Warning: Attempting to execute the command </FONT>
<BR><FONT SIZE=2>> > "/usr/bin/printf "%b" "Service: NTP\nHost: odin\nAddress: </FONT>
<BR><FONT SIZE=2>> > 204.255.194.4\nState: OK\nInfo: OK: Time difference -0.033110 </FONT>
<BR><FONT SIZE=2>> > seconds\nDate: Thu Oct 24 11:41:34 EDT 2002" |  -s "RECOVERY: </FONT>
<BR><FONT SIZE=2>>                                                ^^^^</FONT>
<BR><FONT SIZE=2>> > Odin Sun E3000/NTP is OK" meinholz@imcingular.com" resulted </FONT>
<BR><FONT SIZE=2>> > in a return code of 127.  Make sure the script or binary you </FONT>
<BR><FONT SIZE=2>> > are trying to execute actually exists...</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </snip></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> printf is not your problem, but at the mark there is no mail </FONT>
<BR><FONT SIZE=2>> command. printf</FONT>
<BR><FONT SIZE=2>> is only used to pipe the mail message body to your mail </FONT>
<BR><FONT SIZE=2>> program. '-s "blah"'</FONT>
<BR><FONT SIZE=2>> is the subject and 'meinholz@...' is the receipient. I think </FONT>
<BR><FONT SIZE=2>> qmail never</FONT>
<BR><FONT SIZE=2>> see's your mail.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Can you post your notify-by-email (or host-notify-by-email) </FONT>
<BR><FONT SIZE=2>> command from</FONT>
<BR><FONT SIZE=2>> your (misc-) commands.cfg?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -vol</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>

</BODY>
</HTML>