escaping $ signs

Andreas Ericsson ae at op5.se
Fri May 27 16:46:00 CEST 2005


HP Geeza wrote:
> Unfortunately i now get SQLAgent: Unknown  in the status info for the 
> host...i.e it is trying to read an nt service called SQLAgent rather 
> then SQLAgent$BKUPEXEC - which is the name of the service im trying to 
> monitor
> 

The shell interpolates $BKUPEXEC to the variable named $BKUPEXEC. You'll 
have to escape it in the usual shell manner as well.

> ANY OTHER IDEAS????
> 

Don't shout.

>> From: Andreas Ericsson <ae at op5.se>
>> To: HP Geeza <getbacktome3 at hotmail.com>
>> CC: nagios-users at lists.sourceforge.net
>> Subject: Re: [Nagios-users] escaping $ signs
>> Date: Fri, 27 May 2005 15:37:52 +0200
>>
>> HP Geeza wrote:
>>
>>> Hi
>>>
>>> Does anybody know how to escape $ signs in service definitions??? I 
>>> still haven't managed to crack this....here's what i am trying to do.
>>>
>>
>> $$ yields $, according to docs.
>>
>>> I have a service definition:
>>> # Service definition
>>> define service
>>> {
>>>        use                             generic-service         ; Name 
>>> of service template to use
>>>        host_name                       winbackupServer
>>>        service_description             SQLAgent BKUPEXEC
>>>        check_command                   
>>> check_nt_service!"SQLAgent\$BKUPEXEC"
>>> }
>>>
>>>
>>> Here's my command definition:
>>> # 'check_nt_ntservice' command definition
>>> define command
>>> {
>>>        command_name    check_nt_service
>>>        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v 
>>> SERVICESTATE -l $ARG1$
>>> }
>>>
>>>
>>> BUT THE STATUS DEFINITION FOR THIS HOST COMES UP WITH:
>>> SQLAgent$BKUPEXEC$: Unknown
>>>
>>> The nt service which i am trying to monitor is SQLAgent$BKUPEXEC
>>>
>>> ANY HELP WOULD BE MUCH APPRECIATED
>>>
>>> _________________________________________________________________
>>> Be the first to hear what's new at MSN - sign up to our free 
>>> newsletters! http://www.msn.co.uk/newsletters
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by Yahoo.
>>> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
>>> Search APIs Find out how you can build Yahoo! directly into your own
>>> Applications - visit 
>>> http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
>>> _______________________________________________
>>> 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
>>>
>>
>> -- 
>> Andreas Ericsson                   andreas.ericsson at op5.se
>> OP5 AB                             www.op5.se
>> Lead Developer
> 
> 
> _________________________________________________________________
> Be the first to hear what's new at MSN - sign up to our free 
> newsletters! http://www.msn.co.uk/newsletters
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
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