A monitoring application for Docker containers and system processes with email alerts and weekly summaries.
- Continuous Monitoring: Tracks Docker containers and system processes by their PID
- Instant Alerts: Sends immediate email notifications when monitored entities stop
- Status Reporting: Provides comprehensive weekly summary reports every Sunday
- Management API: RESTful endpoints for managing monitored entities
- Secure Configuration: Jasypt encryption support for sensitive credentials
- Java 17
- Maven 3.9.x
- Docker (for container monitoring)
- SMTP server access (for notifications)
- Spring Boot: Version 2.7.18
- Docker Java Client: Version 3.4.2 for container monitoring
- Spring Mail: For sending email notifications
- Jasypt: For encrypting sensitive configuration values
- Lombok: For reducing boilerplate code
This project is licensed under the Apache License 2.0 . See the LICENSE file for details.
Edit application.yml:
watchdog.check-interval: Monitoring frequency (ms).summary-time: Cron notation for Weekly summary time (eq- "0 0 11 * * WED")spring.mail: SMTP settings for email. (username, recipients, host, port)
- Note: Make sure you run the application in the same terminal after setting the environment variables.
export JASYPT_ENCRYPTOR_PASSWORD=watchdog123export MAIL_PASSWORD=yourmailpassword
- Build:
mvn clean install - Run:
mvn spring-boot:run
-
Start a Docker Container
docker run --name test-container -d nginx -
Add it to monitoring:
curl -X POST "http://localhost:8080/watchdog/entities" \ -H "Content-Type: application/json" \ -d '{"name":"test-container122","docker":true,"active":true}'
- Trigger an alert:
docker stop test-container
-
Start a test process:
sleep 3600 &# Note this PID -
Add it to monitoring:
curl -X POST "http://localhost:8080/watchdog/entities" \ -H "Content-Type: application/json" \ -d '{"pid":55881,"docker":false,"active":true}'
- Trigger an alert:
docker stop test-container
- Set
summary-timeinapplication.ymlto a time that is close to the current time.
curl http://localhost:8080/watchdog/entities
curl -X DELETE "http://localhost:8080/watchdog/entities/test-container"
curl -X DELETE "http://localhost:8080/watchdog/entities/12345"