JMX Connection refused
JMX Connection refused
hi team,
i have setup jmx for monitor jvm
- Added parameters to jvm :
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=9000
- port was ready :
[root@dc-nagiosxi-uat01 mSign]# telnet 192.168.104.250 9000
Trying 192.168.104.250...
Connected to 192.168.104.250.
Escape character is '^]'.
- but run check_jvm was getting error :
[root@dc-nagiosxi-uat01 libexec]# /usr/local/nagios/libexec/check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
JMX CRITICAL - Error opening RMI connection: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
i have setup jmx for monitor jvm
- Added parameters to jvm :
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=9000
- port was ready :
[root@dc-nagiosxi-uat01 mSign]# telnet 192.168.104.250 9000
Trying 192.168.104.250...
Connected to 192.168.104.250.
Escape character is '^]'.
- but run check_jvm was getting error :
[root@dc-nagiosxi-uat01 libexec]# /usr/local/nagios/libexec/check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
JMX CRITICAL - Error opening RMI connection: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
Re: JMX Connection refused
Hello @sacom01
Thanks for reaching out, and providing the telnet results on port 9000. Want to verify that there is no security application or anything else blocking since we are getting:
Please post the output of this command from your XI server:
and
Please let us know the results,
Perry
Thanks for reaching out, and providing the telnet results on port 9000. Want to verify that there is no security application or anything else blocking since we are getting:
Verify selinux is disabled:Connection refused to host
Code: Select all
sestatusCode: Select all
nmap -p 9000 192.168.104.250Code: Select all
sudo ss -tulpn | grep -Ei '9000'Perry
Re: JMX Connection refused
hi Perry,
Thanks for your reply.
Verify selinux is disabled: --> client server is AIX 7.1, already disable firewalld.
Nagios server is Redhat 7
Thanks for your reply.
Verify selinux is disabled: --> client server is AIX 7.1, already disable firewalld.
Nagios server is Redhat 7
You do not have the required permissions to view the files attached to this post.
Re: JMX Connection refused
Hello @sacom01
Thanks for following up with the details and screenshot. What do you have set on the AIX client side?
Thanks,
Perry
Thanks for following up with the details and screenshot. What do you have set on the AIX client side?
Do you see anything logged on the AIX client that is failing?-Dcom.sun.management.jmxremote.port=9000
-Dcom.sun.management.jmxremote.authenticate=?
-Dcom.sun.management.jmxremote.ssl=?
Thanks,
Perry
Re: JMX Connection refused
Hello @sacom01
Please also check to see what 'netstat' says about port 9000 on both.
Perry
Please also check to see what 'netstat' says about port 9000 on both.
- netstat -an | grep -Ei '9000'
Perry
Re: JMX Connection refused
hi Perry,
No log appear in AIX client side.
thanks.
No log appear in AIX client side.
thanks.
You do not have the required permissions to view the files attached to this post.
Re: JMX Connection refused
Hello @sacom01
Thanks for following up with the details. We see that JMX monitoring is enabled with "-Dcom.sun.management.jmxremote"
Understand that you want to end up running this check:
Perry
Thanks for following up with the details. We see that JMX monitoring is enabled with "-Dcom.sun.management.jmxremote"
Understand that you want to end up running this check:
For the time being let's verify that we can get a check to circle back with results:/usr/local/nagios/libexec/check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
Code: Select all
java -jar check_jvm.jar -s "service:jmx:rmi:///jndi/rmi://yourhostaddresshere:9000/jmxrmi" -u 'username' -p 'password'-t token -C "Uptime" -w 10 -c 20Code: Select all
java -jar check_jvm.jar -s service:jmx:rmi:///jndi/rmi://yourhostaddresshere:9000/jmxrmi -u 'username' -p 'password' -t token -C Uptime,ThreadCount -w 10 -c 20
Perry
Re: JMX Connection refused
hi Perry,
i dont know what is "-u 'username' -p 'password'", i indicated connection protocol is unsecure :
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
If i do not specify username password, the results are :
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi -t mytoken -C Uptime,ThreadCount -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s "service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi" -t mytoken -C "Uptime" -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
i dont know what is "-u 'username' -p 'password'", i indicated connection protocol is unsecure :
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
If i do not specify username password, the results are :
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi -t mytoken -C Uptime,ThreadCount -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s "service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi" -t mytoken -C "Uptime" -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
Re: JMX Connection refused
Hello @sacom01
Checking on the specifics on the credentials, meantime please check on this, should have both:
Thanks,
Perry
Checking on the specifics on the credentials, meantime please check on this, should have both:
Code: Select all
-Dcom.sun.management.jmxremote.port=9000
-Dcom.sun.management.jmxremote.rmi.port=9000
Perry
Re: JMX Connection refused
hi,
i tried but no luck.
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=9000
-Dcom.sun.management.jmxremote.rmi.port=9000
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s "service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi" -u 'username' -p 'password' -t mytoken -C "Uptime" -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
Notice: first, i want to use unsecure connection, so we can skip username and pw. And we need monitor JVM, not jettty
i tried but no luck.
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=9000
-Dcom.sun.management.jmxremote.rmi.port=9000
[root@dc-nagiosxi-uat01 libexec]# java -jar check_jvm.jar -s "service:jmx:rmi:///jndi/rmi://192.168.104.250:9000/jmxrmi" -u 'username' -p 'password' -t mytoken -C "Uptime" -w 10 -c 20
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.104.250; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
Notice: first, i want to use unsecure connection, so we can skip username and pw. And we need monitor JVM, not jettty