Page 1 of 1

Error: Request contained illegal metachars!

Posted: Thu Jun 25, 2015 6:12 pm
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

Re: Error: Request contained illegal metachars!

Posted: Thu Jun 25, 2015 6:40 pm
by stecino
Got rid of the escaping of the single quotes and it worked

Re: Error: Request contained illegal metachars!

Posted: Thu Jun 25, 2015 6:51 pm
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