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
Error: Request contained illegal metachars!
Re: Error: Request contained illegal metachars!
Got rid of the escaping of the single quotes and it worked
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Error: Request contained illegal metachars!
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:
Otherwise I would look at doing something like check_by_ssh
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"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.