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<br><br><div class="gmail_quote">
On Thu, Oct 1, 2009 at 8:28 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><div></div><div class="h5"><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.<br>
<br>
</div></div>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>
<font color="#888888"><br>
Scott Miller<br>
</font><div><div></div><div class="h5"><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">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>
</div></div></blockquote></div><br>