英文:
Zabbix and JMX connection refused
问题
我有一个Zabbix服务器,本地主机上正在运行一个Java网关,但Zabbix无法检查任何JMX数据,因为它显示:
无法连接到[[localhost]:10052]: [111] 拒绝连接
但是,如果我使用https://zabbix.org/wiki/Docs/howto/zabbix_get_jmx 上的Python脚本,我可以得到我的值。以下是我的配置:
zabbix-server.conf:
JavaGateway=localhost
JavaGatewayPort=10052
StartJavaPollers=5
javaGateway.conf:
JavaGateway=localhost
LISTEN_PORT=10052
从日志中我可以看到,如果我使用Zabbix GUI来检查JMX数据,java_gateway日志中什么都没有发生。看起来它似乎无法连接,但我不知道为什么。
英文:
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.
答案1
得分: 1
问题通过将 zabbix-server.conf
中的以下内容更改解决:
JavaGateway=localhost
为:
JavaGateway=127.0.0.1
英文:
Problem solved by changing zabbix-server.conf
from:
JavaGateway=localhost
To:
JavaGateway=127.0.0.1
答案2
得分: 0
请注意,许多人都有类似的问题,认为 zabbix-java-gateway
在运行,但实际上并没有在运行。
确保该进程正在运行并侦听端口 10052
:
netstat -anolp | grep :10052
如果没有输出任何内容,请安装 zabbix-java-gateway
包并启动它。
在Debian/Ubuntu系统中:
sudo apt install zabbix-java-gateway
sudo systemctl start zabbix-java-gateway
在CentOS中:
sudo yum install zabbix-java-gateway
sudo systemctl enable --now zabbix-java-gateway
然后再次尝试。
英文:
Note that lot of people has similar issues believing that the zabbix-java-gateway
is running while it's not.
Be sure to have the process running and listening on port 10052
:
netstat -anolp | grep :10052
If it does not print anything, install the zabbix-java-gateway
package and start it.
In Debian/Ubuntu-based:
sudo apt install zabbix-java-gateway
sudo systemctl start zabbix-java-gateway
In Centos:
sudo yum install zabbix-java-gateway
sudo systemctl enable --now zabbix-java-gateway
Then try again.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论