A Bash script to analyze basic server performance statistics on a Linux server.
The script displays:
- Total CPU usage
- Total memory usage
- Used and free memory
- Memory usage percentage
- Total disk usage
- Used and free disk space
- Disk usage percentage
- Top 5 processes by CPU usage
- Top 5 processes by memory usage
- Operating system version
- System uptime
- Load average
- Number of logged-in users
-
Linux operating system
-
Bash shell
-
Basic Linux commands:
topfreedfpsawk
Clone the repository:
git clone https://github.com/YOUR_USERNAME/server-performance-stats.gitMove into the project directory:
cd server-performance-statsMake the script executable:
chmod +x server-stats.shRun the script:
./server-stats.sh==========================================
SERVER PERFORMANCE STATISTICS
==========================================
CPU Usage:
Total CPU Usage: 12.5%
Memory Usage:
Total Memory: 7845 MB
Used Memory : 2450 MB (31%)
Free Memory : 3100 MB
Disk Usage:
Total Disk: 100G
Used Disk : 40G (40%)
Free Disk : 60G
Top 5 Processes by CPU Usage:
PID PPID CMD %MEM %CPU
Top 5 Processes by Memory Usage:
PID PPID CMD %MEM %CPU