UPDATE: Purposely sending metachars to NRPE

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

UPDATE: Purposely sending metachars to NRPE

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UPDATE: Purposely sending metachars to NRPE

Post 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"?
Be sure to check out our Knowledgebase for helpful articles and solutions!
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: UPDATE: Purposely sending metachars to NRPE

Post 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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UPDATE: Purposely sending metachars to NRPE

Post by lmiltchev »

I am glad the issue was resolved! Is it safe to lock the topic?
Be sure to check out our Knowledgebase for helpful articles and solutions!
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: UPDATE: Purposely sending metachars to NRPE

Post by highness »

lmiltchev wrote:I am glad the issue was resolved! Is it safe to lock the topic?
Yes, please!
Locked