Heartbeat detection of JAVA WEB applications of various application servers (such as Tomcat, Jetty) and WEB servers (such as Apache, Nginx).
How to achieve?
Use HttpClient to initiate a request to the specified server (application-instance) URL according to frequency (10 seconds, 20 seconds...) and record the response information (connection time, whether the connection is successful, whether there are exceptions, response packet size), If an abnormality is detected (the response code is not 200, an exception is thrown...), an email will be sent to the specified address, and a reminder email will be sent when the detection returns to normal.
In the future, more real-time reminder interfaces will be added, such as WeChat and SMS.
2.0.0 and above are refactored using the Spring-Boot framework to move closer to microservices.
JDK-1.8
Spring Boot-1.5.9.RELEASE
Flat UI
Maven-3.1.0
1. No intrusion, independent deployment
2. Can monitor multiple application servers at the same time
3. The request method supports GET and POST; the URL supports http and https. You can specify the request content-type and add request parameters (fixed parameters or random parameters)
4. Add security settings to control user registration, set user permissions, etc.
5. Simple and flexible to use
6. Reminder methods are timely and diverse (currently, email reminders and WeChat reminders have been implemented; text message reminders, etc. will be added in the future)
JRE 1.8+
MySql 5.6+
Tomcat 8+
1. The project is managed by Maven. You need to install maven (the number for development is 3.1.0) and MySql (the number for development is 5.6) on the computer.
2. Download (or clone) the project locally
3. Create a MySQL database (default database name: heart_beat) and run the corresponding SQL script (the script file is located in the others/database directory).
The order of running the script: HeartBeat.ddl -> quartz_mysql_innodb.sql -> initial-db.ddl (this ddl will create the initial administrator account/password: hb/heart_beat)
4. Modify the database connection information (including username, password, etc.) in application.properties (located in the src/main/resources directory)
NOTE: In order to ensure that you can receive reminder emails, please configure mail.develop.address in the configuration file as your email address; if you are in a production environment, please change the mail.develop.environment value to false (true indicates a development environment )
5. Import the local project into the IDE (such as Intellij IDEA), configure Tomcat (or similar servlet running server), and start Tomcat (the default port is 8080)
Another: You can also compile the project into a war file (hb.war) through the maven package command, place the war in Tomcat and start it (note: this method requires adding application.properties to the classpath and correctly configuring the database connection information) .
Or use the java -jar hb.war --spring.config.location=application.properties command to run (note that the path to application.properties must be correct)
Or download the installation package directly from the project's 'dist' directory.
6. After HeartBeat is running, you can use the default administrator account/password: hb/heart_beat for the first login. If it fails, you need to run the initial SQL script file initial-db.ddl (others/database directory) in the database, and use MD5 encryption for the account password. .