Notifications somewhat garbled

Marc Powell marc at ena.com
Wed Mar 17 19:09:24 CET 2004


On Wednesday, March 17, 2004 10:43 AM, Norm Dressler shared with us:

> Hi Everyone,
> 
> The alerts are being sent to my email looking like below.  Does
> anyone have a fix for this command? 
> 
> -----Original Message-----
> From: nagios at inside182.dinmar.com [mailto:nagios at inside182.dinmar.com]
> Sent: Wednesday, March 17, 2004 12:23 PM
> To: alert at inside182.dinmar.com; RECOVERY at inside182.dinmar.com
> Subject: "**
> 
> 
>
""*****""Nagios""*****nnNotification""Type:""RECOVERYnnService:""Local""
>
processor""loadnHost:""FPTOR01""File/Print""ServernAddress:""192.168.60.
>
2nState:""OKnnDate/Time:""Wed""Mar""17""12:23:23""EST""2004nnAdditional"
> "Info:nnOK""-""load""average:""0.00,""0.02,""0.00""

It looks like your service-notify-by-email command isn't interpreting
escape sequences properly (i.e. \n == newline). If you're using echo,
add a -e or try using /usr/bin/printf instead of /bin/echo. You may want
to read the man page for whichever command you are using. I believe that
echo isn't as portable as printf and -e may not be the correct option
under your OS. Here is the command I use under RH7.3 --

# 'service-notify-by-email' command definition
define command{
        command_name    service-notify-by-email
        command_line    /bin/echo -e "Subject: Service $SERVICEDESC$
$SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService: $SERVICEDESC$\nInfo:
$OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s '**
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
**' $CONTACTEMAIL$
        }

--
MArc


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
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