<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.5">
</HEAD>
<BODY>
error is : <BR>
<BR>
Error: Unexpected token or statement in file '/usr/local/nagios/etc/command.cfg' on line 33.<BR>
<BR>
On Tue, 2003-06-10 at 12:09, Skip Montanaro wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373" SIZE="3"><I>    william> Running the preflight check, with nagios v1.1, I get an error
    william> from line 33 in command.cfg:

What's the error message ?

    william> Line 33 is:

    william> command[notify-by-email]=/bin/printf "$OUTPUT$" | /bin/mail -s
    william> '$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$' $CONTACTEMAIL$

Maybe you need /usr/bin/printf and /usr/bin/mail?

    william> I have qmail running on this host (RH v8), so my question is
    william> what is the syntax for sending this notify to qmail. I have
    william> tried /usr/sbin/sendmail -> /var/qmail/bin/sendmail, but then
    william> it does not like the -s switch.

I really doubt you'll need to resort to calling qmail or sendmail to get
this to work on a RedHat system.  You almost certainly have /bin/mail and
/bin/printf (my Mac has both, but in /usr/bin) or can get them from an rpm.
That would be easier than calling sendmail or qmail-faking-sendmail
directly.  If you can't manage to find and/or install /bin/mail, note that
sendmail expects an rfc-2?822 message on stdin.  As a first guess I'd try
something like

    /bin/printf "To: $CONTACTEMAIL$\nSubject: $SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$\n\n$OUTPUT$" | /usr/sbin/sendmail -odb

but that's just a guess.  In any case, I doubt the preflight check is
actually trying (and failing) to execute the /bin/mail and /bin/printf.  I
suspect your problem lies elsewhere.</I></FONT></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>-- 
william f guyton jr
senior network engineer
informs
334.277.0372x133</PRE>
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>