A bash script to analyze and display various server performance metrics including CPU usage, memory usage, disk usage, and process information.
- CPU usage monitoring
- Memory usage statistics (in GB with percentage)
- Disk usage information
- Top 5 CPU-consuming processes
- Top 5 memory-consuming processes
- Additional system information:
- OS version
- System uptime
- Load average
- Logged-in users
- Recent failed login attempts
- Linux-based operating system
- Bash shell
- Basic system utilities (top, free, df, ps, who)
- sudo privileges (for accessing certain log files)
- Clone this repository:
git clone https://github.com/YOUR_USERNAME/server-stats.git- Navigate to the project directory:
cd server-stats- Make the script executable:
chmod +x server-stats.shRun the script:
./server-stats.shTo get full information including system logs:
sudo ./server-stats.shServer Statistics Report - Generated on: Wed Nov 13 2024 14:30:45 EDT
+----------------------------------------+--------------------------------------------------+
| OS Information | Ubuntu 22.04.3 LTS |
+----------------------------------------+--------------------------------------------------+
| System Uptime | 7 days, 3 hours |
+----------------------------------------+--------------------------------------------------+
| CPU Usage | 23.5% |
+----------------------------------------+--------------------------------------------------+
| Memory Usage | 3.2/15.7 GB (20.4%) |
+----------------------------------------+--------------------------------------------------+