Blogger Information
Blog 60
fans 0
comment 0
visits 66627
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
【Zabbix】Zabbix JMX 接口配置
大宝
Original
1176 people have browsed it

参考链接

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)

zabbix镜像-zabbix下载地址-zabbix安装教程-阿里巴巴开源镜像站 (aliyun.com)

5 Java 网关 (zabbix.com)

一、监控端—Zabbix-Server

1、安装zabbix-java-gateway包

  1. [root@zabbix-server ~]# yum install -y zabbix-java-gateway

image-20220215231843778

2、修改zabbix_java_gateway.conf 配置文件

  1. [root@zabbix-server zabbix]# pwd
  2. /etc/zabbix
  3. [root@zabbix-server zabbix]# vim zabbix_java_gateway.conf
  4. 修改部分内容如下:
  5. LISTEN_IP="0.0.0.0" #监听服务器地址
  6. LISTEN_PORT=10052 #监听zabbix_java进程的端口,默认是10052
  7. PID_FILE="/var/run/zabbix/zabbix_java.pid" #zabbix_java的pid路径
  8. START_POLLERS=5 #zabbix_java的进程数
  9. TIMEOUT=10 #zabbix_java超时时间

3、启动zabbix_java_gateway

  1. # 上述zabbix_java_gateway.conf 配置文件可不用修改,直接开启服务
  2. [root@zabbix-server zabbix]# systemctl start zabbix-java-gateway.service
  3. [root@zabbix-server zabbix]# systemctl enable zabbix-java-gateway.service
  4. [root@zabbix-server zabbix]# systemctl status zabbix-java-gateway.service

4、修改server端zabbix_server.conf配置文件

  1. [root@zabbix-server ~]# vim /etc/zabbix/zabbix_server.conf
  2. JavaGateway=192.168.200.60 #本机IP地址
  3. J avaGatewayPort=10052 #监听端口
  4. StartJavaPollers=5 #打开5个监听项

5、重启zabbix-server服务

  1. [root@zabbix-server ~]# systemctl restart zabbix-server

二、被监控端—zabbix-agent

1、安装tomcat,主要用于JVM

  1. [root@zabbix-agent-centos ~]# yum install java-1.8.0-openjdk-devel tomcat-admin-webapps tomcat-docs-webapp
  2. [root@zabbix-agent-centos ~]# rpm -qa | grep tomcat
  3. tomcat-jsp-2.2-api-7.0.76-16.el7_9.noarch
  4. tomcat-lib-7.0.76-16.el7_9.noarch
  5. tomcat-docs-webapp-7.0.76-16.el7_9.noarch
  6. tomcat-el-2.2-api-7.0.76-16.el7_9.noarch
  7. tomcat-7.0.76-16.el7_9.noarch
  8. tomcat-servlet-3.0-api-7.0.76-16.el7_9.noarch
  9. tomcat-admin-webapps-7.0.76-16.el7_9.noarch

2、添加CATALINA_OPTS #启用JVM接口

  1. # vim /etc/sysconfig/tomcat
  2. CATALINA_OPTS="-Djava.rmi.server.hostname=192.168.200.70 -Djavx.management.builder.initial= -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
  1. CATALINA_OPTS="
  2. -Djava.rmi.server.hostname=192.168.200.70 # tomcat主机自己的IP地址,不要写zabbix服务器的地址
  3. -Djavx.management.builder.initial=
  4. -Dcom.sun.management.jmxremote=true # 启用远程监控JMX
  5. -Dcom.sun.management.jmxremote.port=12345 # 默认启动的JMX端口号,要和zabbix添加主机时候的端口一致即可
  6. -Dcom.sun.management.jmxremote.ssl=false # 不使用ssl认证
  7. -Dcom.sun.management.jmxremote.authenticate=false"

3、启动tomcat服务

  1. [root@zabbix-agent-centos ~]# systemctl start tomcat
  2. [root@zabbix-agent-centos ~]# systemctl enable tomcat
  3. [root@zabbix-agent-centos ~]# systemctl status tomcat
  4. [root@zabbix-agent-centos ~]# netstat -tunpl | grep java
  5. tcp6 0 0 127.0.0.1:8005 :::* LISTEN 9397/java
  6. tcp6 0 0 :::42822 :::* LISTEN 9397/java
  7. tcp6 0 0 :::8009 :::* LISTEN 9397/java
  8. tcp6 0 0 :::33419 :::* LISTEN 9397/java
  9. tcp6 0 0 :::8080 :::* LISTEN 9397/java
  10. tcp6 0 0 :::12345 :::* LISTEN 9397/java

三、在被监控主机上添加JMX接口,实验模板

image-20220216001217909

image-20220216001315680

image-20220216002056615

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post