Page 1 of 1

Escaping bracket in config file

Posted: Tue Oct 21, 2014 3:07 am
by sds54
Hello,

I'm trying to check a service on a windows server who contains brackets "Myservice [config] port 2345", but i receive "Could not construct return packet in NRPE handler check client side (nsclient.log) logs..." from NRPE client.
It works for other services who doesn't contain bracket....

How can i escape bracket in my configuration file ?
PS: I've already try with backslash (\).

Re: Escaping bracket in config file

Posted: Tue Oct 21, 2014 3:24 am
by sds54
define service{
use generic-service ; Name of service template to use
host_name myserver
service_description myservice
check_command check_nrpe!checkServiceState!-a ShowAll 'MyService [config] port 2345'

}

Re: Escaping bracket in config file

Posted: Tue Oct 21, 2014 9:21 am
by sds54
OK, resolved !

Just enable in nsc.ini

# COMMAND ARGUMENT PROCESSING
; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.
allow_arguments=1

but it's too unsecure for me....
The service will not be monitor.

If someone else has a better way.... just leave a quick answer in this forum.

Thanks.

Re: Escaping bracket in config file

Posted: Tue Oct 21, 2014 5:03 pm
by slansing
Unfortunately, unless you create a new command definition in nsclient and hard code that whole line in there, that is the only way to do this.