How to monitor multiple JVM processes in Zabbix

How to monitor multiple JVM processes in Zabbix

1. Scenario description:

Our environment uses microservices. Each program has a separate process and a separate port number. However, some results from the jps query may have duplicate names, so some scripts are not suitable for this scenario.

2. Requirements:

Zabbix-server needs to be used to monitor the jvm process on each Agent (the monitoring items are specifically displayed in the template)

3. Prepare the environment:

1.jvm.py script (not original, copied directly from Github, the Github address is attached here, you can go directly to the target address to view the relevant instructions)

2. https://github.com/qiueer/zabbix/blob/master/Tomcat/usage.txt (zabbix/Tomcat/{jvm.py|Qiueer-Template JMX Generic.xml} template and script address)

3.jdk-8u201-linux-x64.tar.gz

4.Configure or disable iptables

4. Formal Installation

1. Install JDK on each Agent and configure environment variables (upload to the specified directory first). Each Agent performs the following operations.

~]# tar zxvf jdk-8u201-linux-x64.tar.gz
~]# vim /etc/profile // Add the following content #JAVA environment variable export JAVA_HOME=/usr/local/jdk1.8.0_201
  export JRE_HOME=${JAVA_HOME}/jre
  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
  export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
  export PATH=$PATH:${JAVA_PATH}
~]# source /etc/profile
~]# ln -s /usr/local/jdk1.8.0_201/bin/java /bin/java // If you don't make this link, you won't be able to get some information about jvm

2. Upload cmdline and jvm.py to the specified directory for testing (each Agent needs to do this)

zabbix_agentd.d]# pwd
  /etc/zabbix/zabbix_agentd.d
zabbix_agentd.d]# mkdir script
script]#ll
  -rw-r--r-- 1 wenkai person 20124 Sep 10 18:55 cmdline-jmxclient-0.10.3.jar // Upload to the /etc/zabbix/zabbix_agentd.d/script directory -rw-r-xr-x 1 root root 13941 Sep 10 18:57 jvm.py
script]# python jvm.py --list // If data in JSON format can be found, the script is available script]# python jvm.py -b 'java.lang:type=Memory' -k 'HeapMemoryUsage.committed' -p 30497
1020067840

3. Configure the web interface template, download the Qiueer-Template JMX Generic.xml template to the local computer and import it into Zabbix to form a new template. The template is equipped with automatic discovery rules, various monitoring items and triggers;

4. After the configuration is completed, wait for a while to find the data on the monitored host, as follows...

Note: Some monitoring items in the template are not applicable to our services and can be disabled here.

Summarize

The above is the method of Zabbix monitoring multiple JVM processes introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to monitor oracle database using zabbix agent2
  • How to deploy zabbix_agent in docker
  • Installation and configuration method of Zabbix Agent on Linux platform
  • Install and configure Zabbix Agentd on Windows
  • Zabbix implements batch monitoring of port status
  • Detailed process of zabbix monitoring process and port through agent

<<:  A brief discussion of 12 classic problems in Angular

>>:  Detailed explanation of several ways to export data in Mysql

Recommend

Solution to leaving gaps between BootStrap grids

Table of contents [See an example]: [The original...

JS+Canvas draws a lucky draw wheel

This article shares the specific code of JS+Canva...

Docker /var/lib/docker/aufs/mnt directory cleaning method

The company's service uses docker, and the di...

Specific usage instructions for mysql-joins

Table of contents Join syntax: 1. InnerJOIN: (Inn...

A detailed introduction to setting up Jenkins on Tencent Cloud Server

Table of contents 1. Connect to Tencent Cloud Ser...

Nginx configuration file detailed explanation and optimization suggestions guide

Table of contents 1. Overview 2. nginx.conf 1) Co...

Hover zoom effect made with CSS3

Result:Implementation code: html <link href=&#...

Detailed explanation of uniapp's global variable implementation

Preface This article summarizes some implementati...

Detailed explanation of Nginx process scheduling problem

Nginx uses a fixed number of multi-process models...

Comparison between Redis and Memcache and how to choose

I've been using redis recently and I find it ...

Detailed tutorial on installing mysql8.0.22 on Alibaba Cloud centos7

1. Download the MySQL installation package First ...

CSS3 to achieve floating cloud animation

Operation effect html <head> <meta chars...

Common JavaScript memory errors and solutions

Table of contents 1. Timer monitoring 2. Event mo...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...