Page 1 of 1

UPDATE: Purposely sending metachars to NRPE

Posted: Mon Feb 02, 2015 1:54 pm
by highness
I've written a few custom checks to measure web site response time(s) and such for a few of our websites from an external source (think Pingdom).

All the checks work fine until I use a URL that contains an question mark. Nagios apparently prepends a slash "\" to the question mark prior to it passing along the check_nrpe command to the monitored host.

Here is what the command looks like CCM --> Services:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.XXX.XXX.XXX -t 30 -c check_a_url -a "-u https://www.ourcompany.com/services/estimator-3.7?wsdl -w 1000 -c 4000"
When I do a test command check, here is the output I get back:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.XXX.XXX.XXX -t 30 -c check_a_url -a "-u https://www.ourcompany.com/services/estimator-3.7\?wsdl -w 1000 -c 4000"
OUTPUT: CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.

When I the same command from the command line on the Nagios host, the checks work as expected, but when I run them from Nagios, I see the illegal metachar error in the monitored host log.

So, is there a way I can get the Nagios host to allow that string to go through unmolested and not try to escape it?

Re: UPDATE: Purposely sending metachars to NRPE

Posted: Mon Feb 02, 2015 4:43 pm
by lmiltchev
Testing from withing the CCM may or may not work properly because of escaping issues. Have you actually tested the check in the GUI by scheduling a forced immediate check? Can you do this and show us the output under the "Service Status Detail"?

Re: UPDATE: Purposely sending metachars to NRPE

Posted: Mon Feb 02, 2015 5:01 pm
by highness
lmiltchev wrote:Testing from withing the CCM may or may not work properly because of escaping issues. Have you actually tested the check in the GUI by scheduling a forced immediate check? Can you do this and show us the output under the "Service Status Detail"?
You're exactly right! CCM may/may not work properly. It didn't in those cases. Thanks!

Re: UPDATE: Purposely sending metachars to NRPE

Posted: Mon Feb 02, 2015 5:05 pm
by lmiltchev
I am glad the issue was resolved! Is it safe to lock the topic?

Re: UPDATE: Purposely sending metachars to NRPE

Posted: Mon Feb 02, 2015 5:32 pm
by highness
lmiltchev wrote:I am glad the issue was resolved! Is it safe to lock the topic?
Yes, please!