[Nagiosplug-help] check_nt and a service with a $ in the name

Andreas Ericsson ae at op5.se
Tue Dec 28 14:13:01 CET 2004


Rob Maij wrote:
> Thanks Andrea
> 
> Created a script to do what you said and it echo'd this into the file
> 
> -H 192.168.100.56 -p 1248 -s ********** -v SERVICESTATE -l MSSQL$ECAS$
> 
> So it seems that Nagios is adding an additional $ to the end of the
> command.  Is there a way I can fix this?
> 

What version of Nagios are you running? If this happens in Nagios 2, it 
will be fixed in the code asap.

In the mean-time, you can hardcode the values in a script and then run 
that script instead of check_nt (have the script call check_nt with the 
proper parameters and do exit $? immediately after the check_nt call.

> -----Original Message-----
> From: Andreas Ericsson [mailto:ae at op5.se] 
> Sent: Tuesday, December 28, 2004 11:39 AM
> To: Rob Maij
> Cc: nagiosplug-help at lists.sourceforge.net
> Subject: Re: [Nagiosplug-help] check_nt and a service with a $ in the
> name
> 
> Rob Maij wrote:
> 
>>I am having issues with the check_nt plugin.  I need to keep an eye on
> 
> a
> 
>>desktop SQL service, but the application that installed it called it
>>MSSQL$ECAS.  It is running on a Windows XP box.
>>
>> 
>>
>>Now this is my command:
>>
>> 
>>
>>define command {
>>
>>        command_name    check_ecas
>>
>>        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -s
>>$USER2$ -v SERVICESTATE -l MSSQL\$ECAS
>>
>>        }
>>
>> 
>>
>>Now when I run it directly from the command line (as shown above) it
>>functions correctly and retrieves the status, but when Nagios runs the
>>command it responds back with 
>>
>> 
>>
>>MSSQL$ECAS$: Unknown 
>>
>> 
>>
>>It comes back with an extra '$'.  I have tried putting an escape at
> 
> the
> 
>>end and also tried it in single quotes.  Neither worked.
>>
>> 
>>
>>Any ideas or help is greatly appreciated.
>>
>>
> 
> 
> This is most likely a Nagios issue. Try replacing the check_nt plugin 
> with a script containing something like;
> echo "$@" > /tmp/foo
> 
> and see what is in /tmp/foo.
> 
> It should contain the command line exactly as it's passed to the plugin,
> 
> after shell mangling.
> 
> Other useful info you might want to supply;
> nagios version
> /bin/sh flavour, version and settings
> 

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




More information about the Help mailing list