Ad Widget

Collapse

Connect JMX with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sby
    Member
    • Jan 2017
    • 59

    #1

    Connect JMX with Zabbix

    Hi,

    I have an issue and searching all day for a solution but cannot find.
    I hope someone can help me with my issue Tomcat 8 cannot connect to Zabbix

    CentOS 7
    Zabbix server: 4.2.1
    Zabbix Java Gateway runs on the Zabbix server.

    Client server:
    CentOS 7
    Tomcat 8.5.35

    When I want to connect from Zabbix to client-server I get the following error.

    [root@zabbix scripts]# ./zabbix_get_java.sh localhost 10052 (ip) 9200 service:jmx:rmi:///jndi/rmi://(ip):9200/jmxrmi 'jmx["java.lang:type=Threading",ThreadCount]'
    {"response":"failed","error":"Connection timed out: service:jmx:rmi:\/\/\/jndi\/rmi:\/\/(ip):9200\/jmxrmi"}

    [root@zabbix scripts]# ./zabbix_get_jmx localhost 10052 (ip) 9200 'jmx["java.lang:type=Threading",ThreadCount]'
    {"response":"failed","error":"No value for jmx_endpoint"}

    I don't understand what I can do to fix this issue.

    In my setenv.sh on the client-server I have:

    CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9200 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

    When I check if the port is online on the client-server:

    [root@cwh bin]# netstat -natp | grep 9200
    tcp6 0 0 :::9200 :::* LISTEN 25808/java

    What is wrong can someone help me, please.

    ----------------------

    IMPORTANT info the Client-server is behind a NAT with local IP to public IP by the router.
    Can that be the issue for this problem?


    regards,
    Last edited by sby; 16-05-2019, 15:04.
  • drgr33n
    Junior Member
    • Dec 2015
    • 13

    #2
    I don't normally access JMX like that over the cli and I'm not 100% what your script is doing but I did notice you're using 0.0.0.0 for the client IP. That should be the IP address of the target client.

    10.10.0.2 (server) <--> 10.10.0.3 (client)

    ./zabbix_get_java.sh localhost 10052 10.10.0.3 9200 service:jmx:rmi:///jndi/rmi://10.10.0.3:9200/jmxrmi 'jmx["java.lang:type=Threading",ThreadCount]'

    The syntax is
    ./zabbix_get_java.sh {server_ip} {discovery_port} {client_ip} {client_port} service:jmx:rmi:///jndi/rmi://{client_ip}:{client_port}/jmxrmi 'jmx[{mbean}'

    Comment

    • sby
      Member
      • Jan 2017
      • 59

      #3
      Hi, Thank you for your reaction.

      This is not working I don't use 0.0.0.0 as IP, I have removed the real IP's.

      When I do telnet from the Zabbix server to the server where the JMX is running then telnet works.

      But I get no info from the JMX agent how can I solve it.


      Comment

      Working...