This project demonstrates how to monitor Jenkins availability on an AWS EC2 instance using a custom Bash script, automate monitoring using cron jobs, and trigger alerts using AWS CloudWatch and SNS when Jenkins goes down.
- Monitor Jenkins status (UP/DOWN)
- Automate health checks using cron
- Capture logs for analysis
- Send real-time email alerts on failure using AWS services
- AWS EC2 (Ubuntu 22.04)
- Jenkins
- Bash Scripting
- Cron Jobs
- AWS CloudWatch
- AWS SNS (Simple Notification Service)
- IAM Roles
- EC2 hosts Jenkins server
- Monitoring script checks Jenkins availability
- Logs are sent to CloudWatch
- CloudWatch triggers alarms on failure
- SNS sends email alerts to users
- Launch Ubuntu 22.04 instance
- Open ports: 22 (SSH), 8080 (Jenkins)
- Install Java (required for Jenkins)
- Install Jenkins and access via browser
- Unlock Jenkins using initial admin password
- Install plugins and access dashboard
- Create Bash script to check Jenkins status
- Store output logs (UP/DOWN)
- Schedule script execution at regular intervals
- Verify logs for continuous monitoring
- Stop Jenkins service → detect DOWN
- Restart Jenkins → detect UP
- Create IAM role for EC2
- Install and configure CloudWatch agent
- Send logs to CloudWatch
- Create metric filters from logs
- Convert logs into CloudWatch metrics
- Create CloudWatch Alarm for Jenkins downtime
- Configure SNS topic and email subscription
- Stop Jenkins service
- CloudWatch alarm triggers
- SNS sends email notification
- Automated Jenkins health monitoring
- Real-time failure detection
- Cloud-based log tracking
- Instant email alerts via SNS
- Minimal manual intervention
Detailed step-by-step implementation is available in:
- 📄 PDF file
Successfully implemented a monitoring and alerting system that detects Jenkins downtime and notifies users via email automatically.
This project ensures high availability monitoring of Jenkins using AWS services, combining automation, logging, and alerting to create a reliable DevOps solution.
``