Ad Widget

Collapse

Java Gateway monitoring issue - "org.json.JSONException: No value for conn"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onallion
    Senior Member
    • Mar 2016
    • 131

    #1

    Java Gateway monitoring issue - "org.json.JSONException: No value for conn"

    Hey guys,

    I am using Zabbix Server and Zabbix Java Gateway 3.4, they are both installed on the same host.
    I am trying to monitor a Java app running on a remote host.

    These are the app's JMX configuration:

    Code:
    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.rmi.port=9011 -Djava.rmi.server.hostname=XX.X.X.XXX -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
    In the Zabbix server, the host has a JMX interface with its proper IP and the port "9010". I have tested the ports and they are accessible, not blocked by firewall.

    When I put the "Template app generic Java JMX" template on the host, I get no data.
    This is the Debug log from the Java Gateway:

    Code:
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG com.zabbix.gateway.SocketProcessor - starting to process incoming connection
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading Zabbix protocol header
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 8 bytes of data length
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 162 bytes of request data
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - received the following data in request: {"request":"java gateway jmx","jmx_endpoint":"service:jmx:rmi:///jndi/rmi://xx.x.x.xxx:9010/jmxrmi","keys":["jmx[\"java.lang:type=Memory\",HeapMemoryUsage.max]"]}
    2019-09-05 09:27:12.875 [pool-1-thread-2] WARN  com.zabbix.gateway.SocketProcessor - error processing request
    com.zabbix.gateway.ZabbixException: org.json.JSONException: No value for conn
            at com.zabbix.gateway.JMXItemChecker.<init>(JMXItemChecker.java:70) ~[zabbix-java-gateway.jar:na]
            at com.zabbix.gateway.SocketProcessor.run(SocketProcessor.java:58) ~[zabbix-java-gateway.jar:na]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_222]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_222]
            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]
    Caused by: org.json.JSONException: No value for conn
            at org.json.JSONObject.get(JSONObject.java:354) ~[json.jar:na]
            at org.json.JSONObject.getString(JSONObject.java:510) ~[json.jar:na]
            at com.zabbix.gateway.JMXItemChecker.<init>(JMXItemChecker.java:55) ~[zabbix-java-gateway.jar:na]
            ... 4 common frames omitted
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - sending the following data in response: {"response":"failed","error":"org.json.JSONException: No value for conn"}
    2019-09-05 09:27:12.875 [pool-1-thread-2] DEBUG com.zabbix.gateway.SocketProcessor - finished processing incoming connection
    What's important to note is that when I use the first script suggested here:
    Join the friendly and open Zabbix community on our forums and social media platforms.

    I get this error: {"response":"failed","error":"bad protocol header: 7B 22 72 65 71"}

    But when I use the second script, which does not rely on zabbix_get, I do get the proper response:
    {"data":[{"value":"2561671168"}],"response":"success"}

    Which has lead me to believe this is a Zabbix issue and not related to my network or configuration.

    If anyone can help me figure this out, I would very much appreciate it
  • onallion
    Senior Member
    • Mar 2016
    • 131

    #2
    Bumping this up a bit, can anyone help?

    Comment

    Working...