check_jmx plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
katya
Posts: 224
Joined: Mon Aug 18, 2014 9:07 am

check_jmx plugin

Post by katya »

Hi Team,

I hope you doing well.

i install check_jmx plugin on my Nagios Server.

The URl of the JMX console is: https://10.146.2.37:8443/jmx-console/

i Can understand what i need to run with ./check_jmx -U

it need to be: ./check_jmx -U https://10.146.2.37:8443/jmx-console/

Can you please suggest how i need to run this?

thanks a lot.
Katya
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: check_jmx plugin

Post by bwallace »

Have you checked out our guide on check_jmx?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

I would start with getting the example command on page 2 (pasted below as well) to work via CLI first, and then go from there.

Code: Select all

./check_jmx -U service:jmx:rmi:///jndi/rmi://<hostaddress>:<port>/jmxrmi -O java.lang:type=Memory 
-A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
Be sure to check out the Knowledgebase for helpful articles and solutions!
katya
Posts: 224
Joined: Mon Aug 18, 2014 9:07 am

Re: check_jmx plugin

Post by katya »

-bash-4.1# ./check_jmx -U service:jmx:rmi:///jndi/rmi://10.146.2.37:8443/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
JMX CRITICAL Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint] connecting to java.lang:type=Memory by URL service:jmx:rmi:///jndi/rmi://10.146.2.37:8443/jmxrmijava.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:356)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:227)
at org.nagios.JMXQuery.connect(JMXQuery.java:53)
at org.nagios.JMXQuery.main(JMXQuery.java:75)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:203)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1914)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1883)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:290)
... 4 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:114)
... 9 more

this is the error i got! what is thi RMI serverr?, basically my URL work with HTTPS not with RMI serve how can i avoid from this RMI server?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_jmx plugin

Post by mcapra »

In the document provided by @bwallace under the "Prerequisites":
A server running JMX that is configured to support remote access
Are you certain that your application is configured this way? Usually the application includes the following options at runtime:

Code: Select all

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<hostname>

katya wrote:basically my URL work with HTTPS not with RMI serve how can i avoid from this RMI server?
I don't know of any plugins that can utilize a JMX console such as the one your environment is currently leveraging. You might check on the exchange:
http://exchange.nagios.org
Former Nagios employee
https://www.mcapra.com/
katya
Posts: 224
Joined: Mon Aug 18, 2014 9:07 am

Re: check_jmx plugin

Post by katya »

Hi Nagios team,

I have one quere for you about check_jmx plugin i want this plugin will run with authentication, some password.

i found that it can run with the following fields:
-u/--username: monitorRole jmx username
-p/--password: monitorRole jmx password

Can you please explain what is this monitorRole and where should i configure this?

thank,
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_jmx plugin

Post by rkennedy »

You would need to add your own authentication, or modify something found from this post. https://support.nagios.com/forum/viewto ... 126#p32123

The other option, is disabling the part asking for auth which the OP came back with - https://support.nagios.com/forum/viewto ... 126#p32170
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_jmx plugin

Post by tmcdonald »

Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?
Former Nagios employee
Locked