<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:w = "urn:schemas-microsoft-com:office:word" xmlns:m = "http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.18210">
<STYLE><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></STYLE>
</HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI" lang=EN-US link=blue vLink=purple>
<DIV>Jason,</DIV>
<DIV> </DIV>
<DIV>  Looking at your notify-by-email definition, there are a lot of escape sequences ( \" ).  I think that's what's messing you up.  My notify-service-by-email definition is shown below.  Start with that and tweak it to your taste.</DIV>
<DIV># 'notify-service-by-email' command definition<BR>define command{<BR>        command_name    notify-service-by-email<BR>        command_line    /usr/bin/printf "%b" "\nDate/Time: $LONGDATETIME$\n\nService: $SERVICEDESC$\n\nService check res<BR>ults: $SERVICEOUTPUT$\n\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\n***** Nagios *****\n\nNotif<BR>ication Type: $NOTIFICATIONTYPE$\n\nAdditional Info:\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTAL<BR>IAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$<BR>        }</DIV>
<DIV> </DIV>
<DIV>Jon<BR><SPAN style="WORD-WRAP: normal; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
<DIV><BR></DIV>
<DIV>
<DIV><EM><STRONG></STRONG></EM></DIV>
<DIV><EM><STRONG>
<DIV><EM><STRONG>Jon Adcock</STRONG></EM></DIV>
<DIV></STRONG></EM><FONT size=1 face=Tahoma>Network Systems Administrator</FONT></DIV></DIV>
<DIV><FONT size=1 face=Tahoma>Leon County MIS<BR>301 S. Monroe St.<BR>Tallahassee, FL  32301<BR>Office:  (850) 606-5518</FONT></DIV>
<DIV><A href="http://www.leoncountyfl.gov/">http://www.leoncountyfl.gov</A></DIV>
<DIV>"People Focused.  Performance Driven."</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><EM><FONT size=1>Please note that under Florida's Public Records laws, most written communications <BR>to or from county staff or officials regarding county business are public records <BR>available to the public and media upon request.  Your e-mail communications may <BR>therefore be subject to public disclosure.<BR></FONT></EM></DIV></DIV></SPAN><BR><BR>>>> On 9/4/2013 at 1:11 PM, Jason Gauthier <jgauthier@lastar.com> wrote:<BR></DIV>
<TABLE style="MARGIN: 0px 0px 0px 15px; FONT-SIZE: 1em" border=0 bgColor=#f3f3f3>
<TBODY>
<TR>
<TD>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">
<DIV class=WordSection1>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">To follow up on my own email. It looks like this is not just the upgrade. I moved my 3.2.1 binary back in, and it still happens.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">And I’ve found that it’s not limited to the notification commands:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314473] SERVICE ALERT: Server86;Server86 - Ping;UNKNOWN;SOFT;1;check_ping: Invalid hostname/address - 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314493] SERVICE ALERT: Server86;Server86 - SAP;CRITICAL;SOFT;1;TCP CRITICAL - Invalid hostname, address or socket: 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314503] HOST ALERT: Server86;DOWN;SOFT;1;check_ping: Invalid hostname/address - 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314533] SERVICE ALERT: Server86;Server86 - Ping;UNKNOWN;HARD;2;check_ping: Invalid hostname/address - 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314543] HOST ALERT: Server86;DOWN;SOFT;2;check_ping: Invalid hostname/address - 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314553] SERVICE ALERT: Server86;Server86 - SAP;CRITICAL;HARD;2;TCP CRITICAL - Invalid hostname, address or socket: 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314553] SERVICE ALERT: Server86;Server86 - Load;WARNING;HARD;10;85% CPU load.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314563] HOST ALERT: Server86;DOWN;SOFT;3;check_ping: Invalid hostname/address - 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">[1378314573] HOST ALERT: Server86;DOWN;SOFT;4;check_ping: Invalid hostname/address – 19216874204<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">(the periods are removed from the IPs)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">I really have no idea what caused this, but I am reviewing my config and changes I made while testing splunk, and opsgenie integration.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p> </o:p></SPAN></P>
<DIV>
<DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt">From:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"> Jason Gauthier <BR><B>Sent:</B> Wednesday, September 04, 2013 10:28 AM<BR><B>To:</B> 'nagios-users@lists.sourceforge.net'<BR><B>Subject:</B> Upgraded from 3.2.1 to 3.5 - macros broke?<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Greetings,<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>It seems during a recent upgrade, my notifications broke!  Well, I did digging and found notification themselves are working, but the macro variables are completely botched.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I took “notify-by-email”, and changed it to this:<o:p></o:p></P>
<P class=MsoNormal>/usr/bin/printf "\"%b\" \"Notification Type: $NOTIFICATIONTYPE$ ($SERVICEACKAUTHOR$)\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\nComment: $SERVICEACKCOMMENT$\" | /bin/mail -s \"** $NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **\" $CONTACTEMAIL$" >> /tmp/nagiosnotify.log<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>So, it will write the contents to a file instead of just directly piped to mail.  Here is what I see:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>"Notification Type: RECOVERY ($)<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Service: $<o:p></o:p></P>
<P class=MsoNormal>Host: v-ww7b2<o:p></o:p></P>
<P class=MsoNormal>Address: 19216876178<o:p></o:p></P>
<P class=MsoNormal>State: $<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Date/Time: W Sp 4 10:18:11 EDT 2013<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Additional Info:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>$<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Comment: $" | /bin/mail -s "** RECOVERY alert - v-ww7b2/$ is $ **" bv<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>It seems like all of the variable are wrong. For instance, the host is v-windows7lab2. <o:p></o:p></P>
<P class=MsoNormal>The email address starts with “bv”, but it ends with a whole lot more!<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I’m not sure what would be causing this, and would appreciate any input.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Thanks!<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P></DIV></DIV></TD></TR></TBODY></TABLE></BODY></HTML>