Page 2 of 2

Re: check_jmx plugin works on client but not on nagios serve

Posted: Tue Nov 21, 2017 5:44 pm
by npolovenko
@jh129666, Sigle quotes are not allowed in NRPE. You may try to enable "nasty characters". On the remote server open nrpe.cfg and enable the following arguments:

Code: Select all

allow nasty characters=true
allow nasty characters=true
When that's done restart NRPE and try passing the command with single and double quotes one more time. But if that doesn't work I recommend hardcoding the base part of the command in nrpe.cfg and only passing the argument that is actually changing. Just like so:

Code: Select all

command[check_jmx]=/usr/local/nagios/plugins/check_jmx -U service:jmx:rmi:///jndi/rmi://$ARG1$:1234/jmxrmi -O org.apache.camel:context=camel-1,type=components,name='"activemq"' -A State
Or

Code: Select all

command[check_jmx]=/usr/local/nagios/plugins/check_jmx -U service:jmx:rmi:///jndi/rmi://$ARG1$/jmxrmi -O org.apache.camel:context=camel-1,type=components,name='"activemq"' -A State
The only condition is that name='"activemq"' stays defined in nrpe.cfg

Re: check_jmx plugin works on client but not on nagios serve

Posted: Tue Nov 28, 2017 10:36 am
by jh129666
Are you referring to the below arguments? If so, those were already enabled in nrpe.cfg and it didn't fix the issue. I'll keep trying to get it working.

dont_blame_nrpe=1
allow_metachars=1

Re: check_jmx plugin works on client but not on nagios serve

Posted: Tue Nov 28, 2017 2:25 pm
by npolovenko
@jh129666, Yes, I was referring to these arguments. Did you look into leaving the "base part" of the command in the command definition and passing the rest as arguments? You could leave the part with name='"activemq"' in the command definition, plus anything else that you're not going to be passing as arguments. And define the rest of the command with $ARGS1$ $ARGS2$ $ARGS3$, ect. Not to say that this is an ideal solution but it may save you time to get everything going.

Re: check_jmx plugin works on client but not on nagios serve

Posted: Tue Dec 12, 2017 2:15 pm
by jh129666
I was able to get this working, so it can be closed. Thanks for your help!!

Re: check_jmx plugin works on client but not on nagios serve

Posted: Tue Dec 12, 2017 2:19 pm
by npolovenko
@jh129666, Sounds good! Closing the thread.