Server端
1、安装zabbix-java-gateway包
yum install -y zabbix-java-gateway
2、修改zabbix_java_gateway.conf 配置文件
vim zabbix_java_gateway.conf
LISTEN_IP=“0.0.0.0”
LISTEN_PORT=10052
PID_FILE=“/var/run/zabbix/zabbix_java.pid”
START_POLLERS=5
TIMEOUT=10
3、启动zabbix_java_gateway
systemctl start zabbix-java-gateway.service
systemctl enable zabbix-java-gateway.service
systemctl status zabbix-java-gateway.service
4、修改server端zabbix_server.conf配置文件
vim /etc/zabbix/zabbix_server.conf
JavaGateway=192.168.200.60
#本机IP地址
JavaGatewayPort=10052#监听端口
StartJavaPollers=5#打开5个监听项
5、重启zabbix-server服务
systemctl restart zabbix-server
客户端agent
1、安装tomcat,主要用于JVM
配置java环境变量(见下方链接)
https://blog.csdn.net/weixin_45027237/article/details/124861407
2、 添加CATALINA_OPTS #启用JVM接口
vim /etc/sysconfig/tomcat
(tar包安装的配置路径为tomcat/bin/catalina.sh
)
CATALINA_OPTS="
-Djava.rmi.server.hostname=192.168.88.141
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=10052
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
3、启动tomcat服务
systemctl start tomcat
systemctl enable tomcat
systemctl status tomcat