escaping $ characters

Andrew Laden Andrew.Laden at tudor.com
Thu May 5 20:48:06 CEST 2005


Nope, wrong problem.

The illegal_macro_output_chars parameter is what strips off the $ in the
output. I can account for that. That's not the problem I am having.

The problem is that the default command that nagios ships with for sending
mail. (the whole printf | mail thing) does escape interpretation. So \\
becomes \ and \C becomes nothing. (ie an entry like \\Host\C$ becomes \Host
when I want \\host\C (assuming illegal_macro.... Is set as default)

You can see them already try to account for this in the check_disk_smb
plugin where they double escape everything.

        my ($mountpt) = "\\\\$host\\$share";

That makes it so that the output in the gui looks correct. (The \\'s all
become \'s)

But when the string gets resent to the notification commands, the \'s get
escaped again. That is what I am trying to avoid.

Thanks
-Andrew


-----Original Message-----
From: Tom Throckmorton [mailto:throck at duke.edu] 
Sent: Thursday, May 05, 2005 2:17 PM
To: Andrew Laden
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] escaping $ characters


On May 05 13:30, Andrew Laden wrote:
 
> 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?

Yes, Andrew - see the documentation for the main configuration file, in the
section titled 'Illegal Macro Output Characters':

http://nagios.sourceforge.net/docs/1_0/configmain.html#illegal_macro_output_
chars

-tt

-- 
Tom Throckmorton
OIT - CASI
Duke University



-------------------------------------------------------
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