Page 1 of 1

check_jmx plugin

Posted: Wed Aug 17, 2016 5:45 am
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

Re: check_jmx plugin

Posted: Wed Aug 17, 2016 10:48 am
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

Re: check_jmx plugin

Posted: Wed Aug 17, 2016 11:39 am
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?

Re: check_jmx plugin

Posted: Wed Aug 17, 2016 12:32 pm
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

Re: check_jmx plugin

Posted: Sun Jan 29, 2017 10:04 am
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,

Re: check_jmx plugin

Posted: Mon Jan 30, 2017 11:28 am
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

Re: check_jmx plugin

Posted: Wed Mar 01, 2017 2:12 pm
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?