Search code examples
javamonitoringjmxzabbix

Zabbix and JMX connection refused


I have Zabbix server and on localhost is running a java-gateway but Zabbix can't check any JMX data becouse it says:

cannot connect to [[localhost]:10052]: [111] Connection refused

but if I use a Python script from https://zabbix.org/wiki/Docs/howto/zabbix_get_jmx, I got my values. Here my config:

zabbix-server.conf:

JavaGateway=localhost
JavaGatewayPort=10052
StartJavaPollers=5

javaGateway.conf:

JavaGateway=localhost
LISTEN_PORT=10052

From logs I can se if I use Zabbix GUI to check JMX data, nothing happens in java_gateway logs. It looks like it's not able to connect but I don't know why.


Solution

  • Problem solved by changing zabbix-server.conf from:

    JavaGateway=localhost
    

    To:

    JavaGateway=127.0.0.1