Error: Request contained illegal metachars!

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
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Error: Request contained illegal metachars!

Post by stecino »

Running this on the NRPE client, works fine

./parse_json_generic.sh 'http://localhost:9200/_cluster/health?pretty=true' \'.status\',\'.timed_out\',\'.number_of_nodes\' "green false 4"
'.status'="green" is OK '.timed_out'=false is OK '.number_of_nodes'=4 is OK

command[check_parse_json_threshold]=/usr/local/nagios/libexec/parse_json_generic.sh $ARG1$ $ARG2$ $ARG3$

Running this from nagios server

./check_nrpe -H xx.xx.xx.xx -c check_parse_json_threshold -a 'http://localhost:9200/_cluster/health?pretty=true' \'.status\',\'.timed_out\',\'.number_of_nodes\' "green false 4"
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

On the client side I see: Error: Request contained illegal metachars!

I found this in the forum

http://support.nagios.com/forum/viewtop ... 7&p=106518
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Error: Request contained illegal metachars!

Post by stecino »

Got rid of the escaping of the single quotes and it worked
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Error: Request contained illegal metachars!

Post by Box293 »

You could try the fix that you referenced in the other post which would require you to re-compile nrpe on the client.

Really there is no other solution, I believe it's the \ which are the cause of the problem.

An alternate solution is something like:

Code: Select all

command[check_parse_json_threshold]=/usr/local/nagios/libexec/parse_json_generic.sh $ARG1$ \'$ARG2$\',\'$ARG3$\',\'$ARG4$\' $ARG5$

./check_nrpe -H xx.xx.xx.xx -c check_parse_json_threshold -a 'http://localhost:9200/_cluster/health?pretty=true' .status .timed_out .number_of_nodes "green false 4"
Otherwise I would look at doing something like check_by_ssh
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked