i am currently trying to monitor jmx using nrpe and it works on my jmx server but doesnt work on the remote nagios server, this only happens when the command has a special character in, please see successful command ran on jx server and unsuccessful command on remote nagios xi server
jmx server: lxatmsd1 libexec]$ ./check_jmx -U service:jmx:rmi:///jndi/rmi://lxatmsd1:9077/jmxrmi -O com.bea:ServerRuntime=tmsServer1,Name=TMS'!'TMSJMSServer1@IE_TO_TMS_QUEUE,Type=JMSDestinationRuntime,JMSServerRuntime=TMSJMSServer1 -A ConsumersTotalCount -K used -I ConsumersTotalCount -J used -vvvv -w 5 -c 10
JMX WARNING - ConsumersTotalCount.used=16 | ConsumersTotalCount.used=1616
nagiosxiserver: ./check_nrpe -H lxatmsd1 -c -n check_jmx -a '-U service:jmx:rmi:///jndi/rmi://lxatmsd1:9077/jmxrmi -O com.bea:ServerRuntime=tmsServer1,Name=TMS\!TMSJMSServer1@IE_T O_TMS_QUEUE,Type=JMSDestinationRuntime,JMSServerRuntime=TMSJMSServer1 -A ConsumersTotalCount -K used -I ConsumersTotalCount -J used -vvvv -w 5 -c 10'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected)
i have tried other options like putting double quotes or a slash infront of the special characters but it still dosent work, please your help will be appriciated
using nrpe to monitor jmx
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: using nrpe to monitor jmx
You could try defining the commands in your nrpe.cfg file on your jmx server so that you don't have to send all the arguments across.
It does mean you will need to define all your commands on the jmx server but it may be simpler this way.
It does mean you will need to define all your commands on the jmx server but it may be simpler this way.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: using nrpe to monitor jmx
i already defined the command in nrpe.cfg,
i just have issues with the output when it involves special characters as shown in the above example.
i just have issues with the output when it involves special characters as shown in the above example.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: using nrpe to monitor jmx
How do you know it's an output issue? Could NRPE be having issues with executing the received arguments? How have you tested to rule this out?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: using nrpe to monitor jmx
i know that because it works with other arguements that do not have special characters
Re: using nrpe to monitor jmx
Can you show us how the "check_jmx" command is defined in the nrpe.cfg on the remote machine? I don't see any special characters in the output... The output of the check is this (see below), correct?i already defined the command in nrpe.cfg,
i just have issues with the output when it involves special characters as shown in the above example.
Note: I believe @Box293 suggested that you could "hardcode" the arguments in your "check_jmx" command in the nrpe.cfg file, so that you won't have to pass them to check_nrpe.JMX WARNING - ConsumersTotalCount.used=16 | ConsumersTotalCount.used=1616
For example, you could have something like this (on the client):
Code: Select all
command[check_jmx]=/path/to/check_jmx -U service:jmx:rmi:///jndi/rmi://lxatmsd1:9077/jmxrmi -O com.bea:ServerRuntime=tmsServer1,Name=TMS'!'TMSJMSServer1@IE_TO_TMS_QUEUE,Type=JMSDestinationRuntime,JMSServerRuntime=TMSJMSServer1 -A ConsumersTotalCount -K used -I ConsumersTotalCount -J used -vvvv -w 5 -c 10Code: Select all
./check_nrpe -H lxatmsd1 -c -n check_jmxBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: using nrpe to monitor jmx
hard coding the command worked
Re: using nrpe to monitor jmx
Great! Let us know if this is an acceptable "workaround", and if we could close this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: using nrpe to monitor jmx
please close the case