Server-Performance-Stat

Server Performance Stats

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/ —

Description

This script provides comprehensive server performance metrics including:

Features

Requirements

Installation

  1. Clone this repository:
    git clone https://github.com/Shegxy69/Server-Performance-Stat.git
    cd Server-Performance-Stat
    
  2. Make the script executable:
    chmod +x server-stats.sh
    

Usage

Basic Usage

Run the script as a normal user:

./server-stats.sh

With Sudo (to see failed login attempts)

sudo ./server-stats.sh

Sample Output

========================================
    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

Run every hour

0 * * * * /path/to/server-stats.sh > /path/to/logs/server-stats-$(date +\%Y\%m\%d-\%H\%M).log 2>&1

Learning Objectives

This project demonstrates:

What I Learned

Troubleshooting

Issue: Permission denied

chmod +x server-stats.sh

Issue: Cannot see failed login attempts

sudo ./server-stats.sh

Author: Oluwasegun Shobajo

GitHub: @Shegxy69

🔗 Project URL

Live Repository: https://github.com/Shegxy69/Server-Performance-Stat

License

This project is open source and available under the MIT License.

Acknowledgments


⭐ If you found this helpful, please star this repository!