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

Andreas Ericsson ae at op5.se
Tue Dec 28 08:39:03 CET 2004


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