check_jmx plugin works on client but not on nagios server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jh129666
Posts: 98
Joined: Mon Feb 11, 2013 3:45 pm

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

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jh129666
Posts: 98
Joined: Mon Feb 11, 2013 3:45 pm

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

Post by jh129666 »

I was able to get this working, so it can be closed. Thanks for your help!!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

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

Post by npolovenko »

@jh129666, Sounds good! Closing the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked