Escaping bracket in config file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sds54
Posts: 6
Joined: Tue Dec 10, 2013 3:02 am

Escaping bracket in config file

Post 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 (\).
sds54
Posts: 6
Joined: Tue Dec 10, 2013 3:02 am

Re: Escaping bracket in config file

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

}
sds54
Posts: 6
Joined: Tue Dec 10, 2013 3:02 am

Re: Escaping bracket in config file

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Escaping bracket in config file

Post 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.
Locked