A bash script to analyze and monitor Linux server performance statistics.
https://roadmap.sh/projects/server-stats GitHub Repository: https://github.com/Shegxy69/Server-Performance-Stat Project Page: https://shegxy69.github.io/Server-Performance-Stat/ —
This script provides comprehensive server performance metrics including:
top, free, df, ps, uptime, whosudo access (optional, for failed login attempts)git clone https://github.com/Shegxy69/Server-Performance-Stat.git
cd Server-Performance-Stat
chmod +x server-stats.sh
Run the script as a normal user:
./server-stats.sh
sudo ./server-stats.sh
========================================
SERVER PERFORMANCE STATS
========================================
1. Total CPU Usage:
-------------------
CPU Usage: 0.0%
2. Total Memory Usage:
----------------------
Total Memory: 1771 MB
Used Memory: 738 MB
Free Memory: 653 MB
Memory Usage: 41.67%
3. Total Disk Usage:
--------------------
Total Disk: 17G
Used Disk: 5.1G
0AFree Disk: 12G
Disk Usage: 30%
### Automated Monitoring with Cron
Schedule the script to run automatically:
### Run daily at 9:00 AM
```bash
crontab -e
# Add this line:
0 9 * * * /path/to/server-stats.sh > /path/to/logs/server-stats-$(date +\%Y\%m\%d).log 2>&1
0 * * * * /path/to/server-stats.sh > /path/to/logs/server-stats-$(date +\%Y\%m\%d-\%H\%M).log 2>&1
This project demonstrates:
awk, sed, grepIssue: Permission denied
chmod +x server-stats.sh
Issue: Cannot see failed login attempts
sudo ./server-stats.sh
GitHub: @Shegxy69
Live Repository: https://github.com/Shegxy69/Server-Performance-Stat
This project is open source and available under the MIT License.
⭐ If you found this helpful, please star this repository!