Tomcat monitoring series-Introduction to monitoring tools and tomcat monitoring tools
Recently, the company's windows server has just completed Load Balancing processing for Nginx + tomcat. The next step is to monitor the background service software tomcat and nginx.What we want to achieve here is not to monitor performance and other indicators, but whether the service can be accessed normally. If an exception occurs and we want to restart the service, we 'd better send another email to the specified mailbox after the restart.(If the email notification service is activated for this mailbox, real-time SMS notification can be implemented ). It is not very busy near the end of the year. In some spare time, we plan to record the process of implementing this requirement and give it to our colleagues for reference.
This article briefly introduces the selected monitoring tool and will gradually implement other requirements in the future. I checked a lot of information such as JMX from the internet before the software was selected and did not try to use the software, however, a monitoring tool called TOMCAT Moni (TOMCAT Monitoring Assistant) compiled by a third-party user is selected ). This small software is downloaded from a software station: http://www.crsky.com/soft/26486.html
Or go to my uploaded address to download: http://download.csdn.net/detail/a443453087/8403203
The downloaded software package name is tomcatmoni-v0.1beta.zip. After decompression, see:
There are software instructions for use, and each file function must be understood at a Glance. Next, Let's explain the special features.
There are several configurations in the conf. properties file. You can configure the address for regular access and the command to start when an exception occurs. You can also set the access interval and log storage. The parameters are as follows:
######################################## ####################################### Monitoring server Configuration ###################################### ######################################## # Server 1 test address url1 = http: // localhost: 8080/login. jsp # Server 1 startup command (you can call a batch processing, in this batch processing, you write the restart command) exec1 = cmd.exe/c E: \ restartServer. bat # Server 2 test address # url2 = # Server 2 start command # exec2 = # Server 3 test address # url3 = # Server 3 Start command # exec3 == ####### ######################################## ################################ other configurations <span style = "white -space: pre "> </span> ################################# ######################################## ###### interval (in minutes) times = 1 # log record address log = log.txt
After configuration, you can run tomcatmoni.exe to execute monitoring. You can try to manually stop the service to see if it can monitor exceptions and execute specified commands. According to the actual test results, the software can monitor up to three addresses. This software is selected because it is easy to use and can be added to restartServer. bat to execute commands, such as Restarting system services and sending emails. As shown in the sample code in the restartServer. bat file, to stop and restart the tomcat service, you must install tomcat as a service.
This article will introduce other requirements in the future.
Statement: I am a part-time server maintenance engineer. I am a non-professional engineer. If you have any improper descriptions, please leave a message and point out that please pat the bricks and gods.