<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN lang=en-us><FONT face=Arial color=#000000 size=1>
<DIV><FONT face=Arial size=2>I am running 3.0rc2. I am trying to get the
variable $HOSTNOTES$ to appear in notify-host-by-email</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is the notify-host-by-email command definition
that I changed. I added "Notes: $HOSTNOTES$\n\n" in the spot shown
below:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>#
'notify-host-by-email' command definition<BR>define
command{<BR>
command_name
notify-host-by-email<BR>
command_line /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nNotes:
$HOSTNOTES$\n\nDate/Time: $LONGDATETIME$" | /usr/bin/mailx -s "**
$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
$CONTACTEMAIL$<BR> }</FONT>
<DIV>
<P><FONT face=Arial size=2>The host I'm testing with contains only the word:
TEST in its notes field.</FONT></P>
<P><FONT face=Arial size=2>define
host{<BR>
use
generic-router-intrust <BR>
host_name
intrust-bob-ds1 <BR>
alias Intrust BOB
T1 <BR></FONT><FONT face=Arial
size=2>
address
66.243.142.155<BR>
notes
TEST
<BR>
icon_image
switch.gif<BR> statusmap_image
switch.gd2<BR>
hostgroups
intrust-office <BR>
} </FONT></P>
<P><FONT face=Arial size=2>This is the debug log output:</FONT></P>
<P><FONT face=Arial size=2>[1201644173.199143] [032.2] [pid=30977] Raw Command:
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type:
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nNotes: $HOSTNOTES$\n\nDate/Time:
$LONGDATETIME$" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert:
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<BR>[1201644173.199170] [032.2]
[pid=30977] Processed Command: /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: PROBLEM\nHost: intrust-bob-ds1\nState:
DOWN\nAddress: 66.243.142.155\nInfo: (Host Check Timed Out)\n\nNotes:
TEST</FONT></P>
<P><FONT face=Arial size=2>The problem is that the processed command gets
truncated and a notification never gets sent. If I change the
notify-host-by-email definition and replace $HOSTNOTES$ with another variable,
$HOSTOUTPUT$ for instance, the debug log shows this:</FONT></P>
<P><FONT face=Arial size=2>[1201644289.198269] [032.2] [pid=30977] Raw Command:
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type:
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nNotes: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert:
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<BR>[1201644289.198292] [032.2]
[pid=30977] Processed Command: /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: PROBLEM\nHost: intrust-bob-ds1\nState:
DOWN\nAddress: 66.243.142.155\nInfo: (Host Check Timed Out)\n\nNotes: (Host
Check Timed Out)\n\nDate/Time: Tue Jan 29 16:04:49 CST 2008" | /usr/bin/mailx -s
"** PROBLEM Host Alert: intrust-bob-ds1 is DOWN **" <A
href="">pat@nicsys.net</A></FONT></P>
<P><FONT face=Arial size=2>The notification gets sent successfully because the
processed command is not truncated.</FONT></P>
<P><FONT face=Arial size=2>I know I have the syntax correct because I have it
working with other variables - it just wont work when I plug in the variable
that I want: $HOSTNOTES$. It is listed as allowed in host notifications in the
docs.<BR></FONT><FONT face=Arial
size=2><BR></P></FONT></DIV></FONT></SPAN></DIV></BODY></HTML>