[Nagios-devel] Bug in notify-host-by-email variables
Posted: Wed Jan 30, 2008 6:44 pm
This is a multi-part message in MIME format.
------=_NextPart_000_003D_01C86380.E86B02B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am running 3.0rc2. I am trying to get the variable $HOSTNOTES$ to =
appear in notify-host-by-email
This is the notify-host-by-email command definition that I changed. I =
added "Notes: $HOSTNOTES$\n\n" in the spot shown below:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
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$
}=20
The host I'm testing with contains only the word: TEST in its notes =
field.
define host{
use generic-router-intrust =20
host_name intrust-bob-ds1 =20
alias Intrust BOB T1 =20
address 66.243.142.155
notes TEST =20
icon_image switch.gif
statusmap_image switch.gd2
hostgroups intrust-office =20
} =20
This is the debug log output:
[1201644173.199143] [032.2] [pid=3D30977] 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$
[1201644173.199170] [032.2] [pid=3D30977] 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
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:
[1201644289.198269] [032.2] [pid=3D30977] 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$
[1201644289.198292] [032.2] [pid=3D30977] 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 **" [email protected]
The notification gets sent successfully because the processed command is =
not truncated.
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.
------=_NextPart_000_003D_01C86380.E86B02B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am running 3.0rc2. I am trying to get =
the=20
variable $HOSTNOTES$ to appear in notify-host-by-email
This is the notify-host-by-email =
command definition=20
that I changed. I added "Notes: $HOSTNOTES$\n\n" in the spot shown=20
below:
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
------=_NextPart_000_003D_01C86380.E86B02B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am running 3.0rc2. I am trying to get the variable $HOSTNOTES$ to =
appear in notify-host-by-email
This is the notify-host-by-email command definition that I changed. I =
added "Notes: $HOSTNOTES$\n\n" in the spot shown below:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
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$
}=20
The host I'm testing with contains only the word: TEST in its notes =
field.
define host{
use generic-router-intrust =20
host_name intrust-bob-ds1 =20
alias Intrust BOB T1 =20
address 66.243.142.155
notes TEST =20
icon_image switch.gif
statusmap_image switch.gd2
hostgroups intrust-office =20
} =20
This is the debug log output:
[1201644173.199143] [032.2] [pid=3D30977] 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$
[1201644173.199170] [032.2] [pid=3D30977] 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
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:
[1201644289.198269] [032.2] [pid=3D30977] 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$
[1201644289.198292] [032.2] [pid=3D30977] 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 **" [email protected]
The notification gets sent successfully because the processed command is =
not truncated.
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.
------=_NextPart_000_003D_01C86380.E86B02B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am running 3.0rc2. I am trying to get =
the=20
variable $HOSTNOTES$ to appear in notify-host-by-email
This is the notify-host-by-email =
command definition=20
that I changed. I added "Notes: $HOSTNOTES$\n\n" in the spot shown=20
below:
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]