correct notify definition to allow for check_nt_disk output to not be blanked.

Rodney Caston rodney.caston at match.com
Thu Aug 4 16:33:46 CEST 2005


I tried it and my output is now 

---

'C:

---


The difference is now I have a single quote being sent before the C


-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Marc
Powell
Sent: Thursday, August 04, 2005 9:30 AM
To: NAGIOS
Subject: RE: [Nagios-users] correct notify definition to allow for
check_nt_disk output to not be blanked.



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Rodney Caston
> Sent: Thursday, August 04, 2005 8:45 AM
> To: NAGIOS
> Subject: [Nagios-users] correct notify definition to allow for
> check_nt_disk output to not be blanked.
> 
> I have the following issue with check_nt_disk, it outputs to nagios
the
> following status information:
> 
> C:\ - total: 203.50 Gb - used: 87.55 Gb (43%) - free 115.95 Gb (57%)
> 
> However, when we receive notifications for this alert, our
> $SERVICEOUTPUT$ only gives us the following information on this alert.
> ...
> 
> Service:	DISK
> Host:	 hostname
> Address: 10.0.2.1
> State: WARNING
> Info: C:
> 
> ...
> 
> Everything after the ":" for "C:\" is being truncated, I'm sure this
is
> due to the "\" being seen as an escape character somehow.
> 
> In misccommands.cfg our pager definition for these alerts is defined
as
> followed.
> ...
> # 'notify-by-epagerusingmutt' command definition (short form)
> define command{
> command_name    notify-by-muttpager-short
> command_line    /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost:
> $HOSTNAME$\n$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate:
> $LONGDATETIME$\n\n\nUser:$CONTACTNAME$" | /usr/bin/mutt -F
> /etc/nagios/muttrc.cfg -e 'set realname=""' -s "`echo
$NOTIFICATIONTYPE$
> | /usr/bin/cut -c '1-3'`: $HOSTNAME$/$SERVICEDESC$ $SERVICESTATE$"
> $CONTACTPAGER$ 2>&1 | logger -p mail.info
> }
> ...
> 
> 
> Should we be putting $SERVICEOUPUT$ in some escaped form or inside
> quotes to prevent this problem?


Yes, try putting it in single quotes like --

# 'notify-by-epagerusingmutt' command definition (short form)
define command{
command_name    notify-by-muttpager-short
command_line    /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost:
$HOSTNAME$\n$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\nInfo: '$SERVICEOUTPUT$'\nDate:
$LONGDATETIME$\n\n\nUser:$CONTACTNAME$" | /usr/bin/mutt -F
/etc/nagios/muttrc.cfg -e 'set realname=""' -s "`echo $NOTIFICATIONTYPE$
| /usr/bin/cut -c '1-3'`: $HOSTNAME$/$SERVICEDESC$ $SERVICESTATE$"
$CONTACTPAGER$ 2>&1 | logger -p mail.info
}

--
Marc


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
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



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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