escaping $ characters

Andrew Laden Andrew.Laden at tudor.com
Thu May 5 19:30:44 CEST 2005


At what points does the escaping/substitution take place.

I am looking at the check samba output, (may be an old version.)

On the GUI/web page, the output looks correct, but in any
mails/notifications that go out, loks of things get stripped. From 2 places.

Illegal charecters in macros, which strips out the $, and escapes, which
keep getting interpreted.

For example. The code in the check_smb does things like "\\\\Host\\share" to
get the gui to print out \\host\share. But when the notification goes out,
the escapes are re-interpreted and you end up with \hosthare. (Note how it
escapes the first letter of share)

This really looks bad when checking C$, as \\host\C$ becomes \host. (if you
even see it at all) That is with single quoting instead of double quoting
the command parameters. If you doublequote, it cuts off everything after the
\\.

Is there some way to control where the macro substituion takes place so it
happens at the same level as the GUI display, so that the same escape scheme
will work?


-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Tedman Eng
Sent: Thursday, May 05, 2005 1:17 PM
To: 'HP Geeza'; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] escaping $ characters


http://nagios.sourceforge.net/docs/1_0/xodtemplate.html

"...Note that the command line is not surrounded in quotes. Also, if you
want to pass a dollar sign ($) on the command line, you have to escape it
with another dollar sign. "



-----Original Message-----
From: HP Geeza [mailto:getbacktome3 at hotmail.com]
Sent: Thursday, May 05, 2005 8:57 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] escaping $ characters


Hi

I was wondering if anybody knew how to escape a $ sign when checking if a 
Windows service is running:

For example i have I have a line in a service:
check_command                   check_nt_service!"MSSQL$BKUPEXEC"
check_command                   check_nt_service!"SQLAgent$BKUPEXEC"

But nagios doesn't seem to like this.  The status information is saying:
MSSQL$: Unknown
SQLAgent$: Unknown

ALL OTHER Windows services are being detected fine (so my check_nt_service 
command is working).....therefor this makes me belive it is the $ sign in 
the name of the service which i am checking for.

_________________________________________________________________
Winks & nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win
an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
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


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win
an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
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



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
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