Looks like your postfix installation isn't really complete since /bin/mail still thinks it's supposed to send using sendmail. On a complete postfix setup you should have a command "sendmail - Postfix to Sendmail compatibility interface" which I believe /bin/mail will use. So the issue here isn't really Nagios-specific, since you're unable to send mail with /bin/mail outside of Nagios as well. If you fix the email setup, Nagios notifications will be delivered just fine, and Postfix setup is too off topic for this list :-) Good luck!<br>
<br><div class="gmail_quote">On Thu, Oct 1, 2009 at 10:23 PM, Scott Miller <span dir="ltr"><<a href="mailto:srmiller@interbel.net">srmiller@interbel.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">[root@mail4 ~]# echo "Hello world" | /bin/mail -s
"Test Email" root@localhost</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">[root@mail4 ~]# /etc/mail/<a href="http://sendmail.cf" target="_blank">sendmail.cf</a>: line 0: cannot open: No
such file or directory</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">[root@mail4 ~]#</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">I’m running postfix – not sure why it’s looking for sendmail.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> Martin Melin
[mailto:<a href="mailto:mmelin@gmail.com" target="_blank">mmelin@gmail.com</a>] <br>
<b>Sent:</b> Thursday, October 01, 2009 11:01 AM<br>
<b>To:</b> <a href="mailto:nagios-users@lists.sourceforge.net" target="_blank">nagios-users@lists.sourceforge.net</a><br>
<b>Subject:</b> Re: [Nagios-users] FW: Not sending e-mails</span></p>

</div><div><div></div><div class="h5">

<p> </p>

<p style="margin-bottom: 12pt;">Try simply copying the
command_line for notify-service-by-email and running it in a shell yourself. Or
just do:<br>
# echo "Hello world" | /bin/mail -s "Test Email"
root@localhost</p>

<div>

<p>On Thu, Oct 1, 2009 at 8:28 PM, Scott Miller <<a href="mailto:srmiller@interbel.net" target="_blank">srmiller@interbel.net</a>> wrote:</p>

<div>

<div>

<p style="margin-bottom: 12pt;"><br>
Scott Miller wrote:<br>
>> I know this has been hit over and over, and I've read literally<br>
everything I<br>
>> could find, but to no avail.  I have a newly install of Nagios
3.2.0 on a<br>
>> Fedora Core 8 with Postfix/Dovecot.  I have a modified script
(postfix<br>
mail<br>
>> queue monitor I shared a week or so ago).  The only thing Nagios
is doing<br>
on<br>
>> this box is looking at local services.  When I change any
threshold so I<br>
>> will go into alarm, it does, but no e-mails get sent out.<br>
>><br>
>> I can see in my logs the following when something comes into alarm:<br>
>><br>
>> [1254408621] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;1;CRITICAL: Postfix mailq has 14 messages queued
for<br>
a<br>
>> total of 12492 Kbytes.<br>
>> [1254408651] SERVICE ALERT: localhost;Current Load;OK;SOFT;2;OK - load<br>
>> average: 4.87, 2.73, 1.43<br>
>> [1254408681] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;2;CRITICAL: Postfix mailq has 16 messages queued
for<br>
a<br>
>> total of 12497 Kbytes.<br>
>> [1254408741] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;3;CRITICAL: Postfix mailq has 16 messages queued
for<br>
a<br>
>> total of 12689 Kbytes.<br>
>> [1254408801] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;HARD;4;CRITICAL: Postfix mailq has 15 messages queued
for<br>
a<br>
>> total of 12494 Kbytes.<br>
>> [1254408801] SERVICE NOTIFICATION: nagiosadmin2;localhost;Postfix Mail<br>
>> Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 15<br>
>> messages queued for a total of 12494 Kbytes.<br>
>> [1254408801] SERVICE NOTIFICATION: nagiosadmin;localhost;Postfix Mail<br>
>> Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 15<br>
>> messages queued for a total of 12494 Kbytes.<br>
>><br>
>> Wondering if anyone could double check the pertinent parts of my
config?<br>
>><br>
>> Thanks in advance.<br>
>><br>
>> Scott Miller<br>
><br>
> What's in your mail log?  Nagios is trying to send notifications
using<br>
> the command you've defined, according to the logs. You haven't provided<br>
> the definition for that command (notify-service-by-email), but I assume<br>
> it's trying to send an email.<br>
><br>
> If you're using anything like the example commands that come with<br>
> Nagios, it is probably using something like "/bin/mail" to send
the<br>
> message, and your mail log would be a good place to look for why it's<br>
> not being delivered.</p>

</div>

</div>

<p>Sorry - didn't include that from the commands.cfg - Here's
what I have.<br>
<br>
commands.cfg<br>
============<br>
# 'notify-host-by-email' command definition<br>
define command{<br>
       command_name    notify-host-by-email<br>
       command_line    /usr/bin/printf
"%b" "***** Nagios<br>
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:<br>
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:<br>
$LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert:<br>
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<br>
       }<br>
<br>
# 'notify-service-by-email' command definition<br>
define command{<br>
       command_name    notify-service-by-email<br>
       command_line    /usr/bin/printf
"%b" "***** Nagios<br>
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:<br>
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:<br>
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional<br>
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$
Service<br>
Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$<br>
       }<br>
<br>
This is the exact same way I have it on another machine running checks for<br>
multiple boxes and devices.  The only difference, is this server is
running<br>
Postfix, the other (working) is running Sendmail.<br>
<br>
In my logs:<br>
/var/log/maillog - grep for nagios - there's nothing<br>
/var/log/messages shows<br>
Oct  1 10:53:20 mail4 nagios: SERVICE NOTIFICATION:<br>
nagiosadmin2;localhost;Postfix Mail<br>
Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 13<br>
messages queued for a total of 3326 Kbytes.<br>
Oct  1 10:53:20 mail4 nagios: SERVICE NOTIFICATION:<br>
nagiosadmin;localhost;Postfix Mail<br>
Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 13<br>
messages queued for a total of 3326 Kbytes.<br>
<br>
Looks like it's trying - maybe something in Postfix stoping it?  I'll have<br>
to do a bit more digging and testing.<br>
<span style="color: rgb(136, 136, 136);"><br>
Scott Miller</span></p>

<div>

<div>

<p><br>
<br>
<br>
------------------------------------------------------------------------------<br>
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA<br>
is the only developer event you need to attend this year. Jumpstart your<br>
developing skills, take BlackBerry mobile applications to market and stay<br>
ahead of the curve. Join us from November 9&#45;12, 2009. Register
now&#33;<br>
<a href="http://p.sf.net/sfu/devconf" target="_blank">http://p.sf.net/sfu/devconf</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null</p>

</div>

</div>

</div>

<p> </p>

</div></div></div>

</div>


<br>------------------------------------------------------------------------------<br>
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA<br>
is the only developer event you need to attend this year. Jumpstart your<br>
developing skills, take BlackBerry mobile applications to market and stay<br>
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;<br>
<a href="http://p.sf.net/sfu/devconf" target="_blank">http://p.sf.net/sfu/devconf</a><br>_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>