In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to use zabbix to monitor tomcat". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use zabbix to monitor tomcat" can help you solve the problem.
Zabbix is an enterprise-level open source solution based on WEB interface that provides distributed system monitoring and network monitoring capabilities. Zabbix can monitor various network parameters to ensure the safe operation of the server system, and provides a flexible notification mechanism to enable system administrators to quickly locate / solve various problems.
Tomcat is roughly distributed:
Agent side: java-gateway service client: catalina.sh modifies web side: JMX interfaces calls (things at the same level as Agent interfaces). Install and configure java-gateway
This article java-gate-way is installed on proxy.
Generally divided into two cases: if the previous compilation and installation has added-enable-java, there is nothing to pay attention to, directly configure the sbin/zabbix_java/settings.sh and zabbix_proxy.conf files. If there is no java option in the previous compilation, you can recompile it, but do not install it. (not recommended) you can also compile and install a new copy in another place, and then copy the entire directory of the compiled and installed zabbix_java, anyway, it makes no difference.
1. Configure settings.sh
The fields in effect for the entire file are as follows:
LISTEN_IP= "0.0.0.0" LISTEN_PORT=10052PID_FILE= "/ zabbix/zabbix/zabbix_java.pid" START_POLLERS=30TIMEOUT=30
two。 Configure zabbix_proxy.conf
The java-related configurations are as follows:
JavaGateway=xx.xx.xx.xxJavaGatewayPort=10052StartJavaPollers=2
3. Start java gateway
Javagateway starts and shuts down using startup.sh and shutdown.sh under zabbix_java to start, then switch to the corresponding directory. / startup.sh will generate the file / zabbix/zabbix/zabbix_java.pid that saves the process number if the startup is successful, but ps-ef to see if there is such a process.
two。 Debug client
Modify the configuration file catalina.sh to add the following fields where port is the communication port of java agent, and hostname is best to enter native IP.
Export CATALINA_OPTS= "- Dcom.sun.management.jmxremote-Dcom.sun.management.jmxremote.authenticate=false-Dcom.sun.management.jmxremote.port=12345-Dcom.sun.management.jmxremote.ssl=false-Djava.rmi.server.hostname=168.192.10.95"
Restart tomcat and restart tomcat.
III. Webside configuration
Add jmx interfaces to the host, click on the monitored host, configure his JMX interfaces, and fill in the native ip and port 12345.
Associate template when the JMX button is green, it will pass. Associate it with two default templates, Apache Tomcat JMX and Generic Java JMX.
four。 Monitoring item debugging in template
The template of Zabbix can not be fully accommodated with tomcat and can only be debugged little by little (most of the time, the startup port of tomcat does not use 8080, many of which are not compliant)
1. Download debugging tools
Download cmdline-jmxclient-0.10.3.jar to the agent
two。 The method of executing a command
Java-jar cmdline-jmxclient-0.10.3.jar-168.192.10.95 ip 12345 + key (note that there is a space in the middle of-168.192.10.95, and ip is the previous hostname. This test requires a high command format, so you can't make a mistake)
Here are some specific implementation examples: (the listed ones are obviously to be adjusted, and those not involved need to be tested by themselves. Anyway, this is the method.)
(1) the command java-jar cmdline-jmxclient-0.10.3.jar-168.192.10.95 12345 outputs the key name, key value and parameter format of the monitoring item in the whole template. It can be said that only if there is something in it, zabbix can be monitored normally.
(2) java-jar cmdline-jmxclient-0.10.3.jar-168.192.10.95 grep type=Manager |
Given this statement, it is found that there is a very obvious difference between the default template and this one. The default template is path=/ and the picture is context=/.
(3) java-jar cmdline-jmxclient-0.10.3.jar-168.192.10.95 grep 12345 globalrequestprocessor |
The above is about the tomcat port, which is very different from the port monitoring items that exist in the default template.
(4) the above command of java-jarcmdline-jmxclient-0.10.3.jar-168.192.10.95:12345 "Catalina:name=" ajp-bio-7007 "type=GlobalRequestProcessor" bytesReceived is also very typical. The format here also represents the format of key in the template, which corresponds to each other one by one. It is also necessary to encounter name=ajp-bio-7007 in the key value.
This is the end of the introduction to "how to use zabbix to monitor tomcat". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.