command.cfg with qmail MTA
Skip Montanaro
skip at pobox.com
Tue Jun 10 19:09:26 CEST 2003
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.
--
Skip Montanaro
skip at pobox.com
http://www.musi-cal.com/
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
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