A Bash-based Linux monitoring and log analysis tool designed to monitor system health, generate structured logs, and provide powerful log analysis capabilities.
Built as a hands-on DevOps learning project covering Linux administration, Bash scripting, troubleshooting, automation, and log management.
- Overview
- Features
- Project Structure
- Installation
- Usage
- Log Analysis
- Validation & Error Handling
- Sample Outputs
- Troubleshooting
- Technologies Used
- What I Learned
- Future Improvements
Linux SysMonitor performs automated health checks on a Linux system and stores results in structured log files.
The accompanying analysis tool enables engineers to:
- Review health check results
- Filter logs by severity
- Identify recurring issues
- Generate summaries
- Perform time-based log analysis
This project was built to strengthen practical Linux and DevOps skills through real-world scripting and troubleshooting.
- CPU Usage Monitoring
- Memory Usage Monitoring
- Disk Usage Monitoring
- SSH Service Health Check
- Cron Service Health Check
- Network Connectivity Validation
- Open Port Inspection
- Recent System Log Collection
- Load Average Monitoring
- System Uptime Monitoring
- Summary Reports
- Severity-Based Filtering
- Top Recurring Issues
- Time-Based Filtering
- Custom Log File Support
- Colored Terminal Output
- Input Validation
- Graceful Error Handling
+-------------------+
| health-check.sh |
+-------------------+
|
v
+-------------------+
| Structured Logs |
| logs/*.log |
+-------------------+
|
v
+-------------------+
| analyse.sh |
+-------------------+
|
+------+------+------+
| | |
v v v
Summary Filtering Top Issues
linux-sysmonitor/
βββ health-check.sh
βββ analyse.sh
βββ logs/
β βββ *.log
βββ sample-output/
β βββ sample-log.log
β βββ summary.txt
β βββ top-issues.txt
β βββ critical.txt
β βββ since.txt
βββ README.md
βββ .gitignore
git clone https://github.com/<your-username>/linux-sysmonitor.git
cd linux-sysmonitorchmod +x health-check.sh
chmod +x analyse.sh./health-check.shThis generates a timestamped log file under:
logs/
Example:
logs/2026-06-23-05-06.log
Generated logs follow the structure:
YYYY-MM-DD HH:MM:SS | LEVEL | MESSAGE
Example:
2026-06-23 05:06:37 | INFO | CPU usage is 10% β healthy
2026-06-23 05:06:37 | WARNING | cron is not running
2026-06-23 05:06:37 | CRITICAL | Disk usage is 96%
./analyse.sh --summaryExample Output:
=================================
Log Summary
=================================
Total Entries: 11
INFO: 9
WARNING: 1
CRITICAL: 1
=================================
./analyse.sh --level INFO./analyse.sh --level WARNING./analyse.sh --level CRITICALDisplay the most frequent log entries:
./analyse.sh --top 5Example:
4 CPU usage is 10% β healthy
3 Memory usage is 28% β healthy
2 cron is not running
Display entries after a specific time:
./analyse.sh --since 10:30Example:
./analyse.sh --since 14:00./analyse.sh --file logs/sample.log --summaryLinux SysMonitor includes validation for:
- Missing arguments
- Invalid flags
- Invalid log levels
- Missing log files
- Missing logs directory
- Empty logs directory
- Invalid user input
./analyse.sh --level TESTOutput:
Error: Invalid level. Use INFO, WARNING, or CRITICAL
./analyse.sh --file missing.logOutput:
Error: File not found: missing.log
Error: logs directory does not exist
Error: No log files found
Store generated examples under:
sample-output/
Suggested files:
sample-output/
βββ sample-log.log
βββ summary.txt
βββ top-issues.txt
βββ critical.txt
βββ since.txt
βββ health-check.png
βββ analysis-summary.png
Example screenshots:
sample-output/health-check.png
sample-output/analysis-summary.png
Generate a new log file:
./health-check.shGenerate a summary:
./analyse.sh --summaryDisplay warning entries:
./analyse.sh --level WARNINGDisplay top recurring issues:
./analyse.sh --top 5Display entries after a specific time:
./analyse.sh --since 12:00chmod +x health-check.sh
chmod +x analyse.shGenerate a log first:
./health-check.shmkdir -p logsInstall ShellCheck:
sudo apt update
sudo apt install shellcheck -yRun analysis:
shellcheck health-check.sh
shellcheck analyse.sh| Category | Tools |
|---|---|
| Scripting | Bash |
| Monitoring | top, free, df |
| Networking | ping, ss |
| Text Processing | awk, grep, sort, uniq |
| Logging | Custom Structured Logs |
| Version Control | Git, GitHub |
| Quality Checks | ShellCheck |
Through this project I gained hands-on experience with:
- Linux Fundamentals
- Bash Scripting
- Shell Functions
- Conditional Logic
- Argument Parsing
- Log Management
- System Monitoring
- Process Monitoring
- Network Troubleshooting
- Text Processing with awk and grep
- Error Handling
- Defensive Scripting
- Git Branching & Pull Requests
- GitHub Project Management
- ShellCheck Best Practices
- Email Alerts
- Slack Notifications
- HTML Report Generation
- Systemd Service Integration
- Cron-Based Scheduling
- Prometheus Metrics Export
- Grafana Dashboard Integration
- Docker Packaging
- Configuration File Support
- Multi-Server Monitoring
This project is intended for learning, experimentation, and portfolio demonstration purposes.
If you found this project useful, consider starring the repository and sharing feedback.
Happy scripting! π§