Nagios plugin check_jmx cannot connect to JMX server
Posted: Fri Dec 09, 2016 4:37 am
Hi,
I am trying tu use a nagios plugin named check_jmx to monitor from a linux client a Jmx/tomcat server on e remote Windows server.
The difficulty here is that we must use SSL.
The JMX server listens on the 8443 port number
Version : Linux centos 7.2, with java 1.8 (From which I run the plugin). The Remote server windows version is 2012 R2.
Note :
- When I try to connect to JMX via the "Java Mission Control" (From windows server): It works well
- When I try to reun the check_jmx plugin while ssl and certificates athentication is disabled on the remote Windows server : It works well.
Thus... the jmxremote feature works well ..... But I still cannot connect when I want to use the ssl
I created a local trustore on my Linux server containing the certificate from the Windows server .....
In the check_jms script I tried to specify many different java options :
-Dcom.sun.management.jmxremote.ssl=True \
-Dcom.sun.management.jmxremote.ssl.need.client.auth=True \
-Dcom.sun.management.jmxremote.port=8443 \
-Dcom.sun.management.jmxremote.registry.ssl=True \
-Dcom.sun.management.jmxremote.password.file=/usr/local/nagios/etc/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=/usr/local/nagios/etc/jmxremote.access \
-Djavax.net.ssl.trustStore=/home/nagios/JMX/truststore.jks \
-Djavax.net.ssl.trustStorePassword=$my_passwd \
-Djavax.net.ssl.trustStoreType=jks \
Please note that these above options are given to the Plugin (java command line) from the Linux server: this is whet the check_jmx plugin do:
/bin/java -verbose -$OPTION_LIST -jar /usr/local/nagios/plugin/check_jmx.jar "$@" "
($OPTION_LIST is all the options I mentionned above.... initially there is no option on the original check_jmx : Only :/bin/java -jar $MY_PATH/check_jmx.jar "$@" )
The error I always get is :
JMX CRITICAL - Error opening connection: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
I investigated a lot on differents forums /website .... I changed the above settings in different manners .... But I always get the same error.
The most frustrating is that I have no more logs neither from the java on the Linux ... nor from the Windows server running the JMX.
Any help would be really appreciated ...
Thanks.
I am trying tu use a nagios plugin named check_jmx to monitor from a linux client a Jmx/tomcat server on e remote Windows server.
The difficulty here is that we must use SSL.
The JMX server listens on the 8443 port number
Version : Linux centos 7.2, with java 1.8 (From which I run the plugin). The Remote server windows version is 2012 R2.
Note :
- When I try to connect to JMX via the "Java Mission Control" (From windows server): It works well
- When I try to reun the check_jmx plugin while ssl and certificates athentication is disabled on the remote Windows server : It works well.
Thus... the jmxremote feature works well ..... But I still cannot connect when I want to use the ssl
I created a local trustore on my Linux server containing the certificate from the Windows server .....
In the check_jms script I tried to specify many different java options :
-Dcom.sun.management.jmxremote.ssl=True \
-Dcom.sun.management.jmxremote.ssl.need.client.auth=True \
-Dcom.sun.management.jmxremote.port=8443 \
-Dcom.sun.management.jmxremote.registry.ssl=True \
-Dcom.sun.management.jmxremote.password.file=/usr/local/nagios/etc/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=/usr/local/nagios/etc/jmxremote.access \
-Djavax.net.ssl.trustStore=/home/nagios/JMX/truststore.jks \
-Djavax.net.ssl.trustStorePassword=$my_passwd \
-Djavax.net.ssl.trustStoreType=jks \
Please note that these above options are given to the Plugin (java command line) from the Linux server: this is whet the check_jmx plugin do:
/bin/java -verbose -$OPTION_LIST -jar /usr/local/nagios/plugin/check_jmx.jar "$@" "
($OPTION_LIST is all the options I mentionned above.... initially there is no option on the original check_jmx : Only :/bin/java -jar $MY_PATH/check_jmx.jar "$@" )
The error I always get is :
JMX CRITICAL - Error opening connection: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
I investigated a lot on differents forums /website .... I changed the above settings in different manners .... But I always get the same error.
The most frustrating is that I have no more logs neither from the java on the Linux ... nor from the Windows server running the JMX.
Any help would be really appreciated ...
Thanks.