A simple Bash script to analyze basic Linux server performance statistics.
- Total CPU usage
- Total memory usage
- Used memory
- Free memory
- Usage percentage
- Total disk usage
- Used disk
- Free disk
- Usage percentage
- Top 5 processes by CPU usage
- Top 5 processes by memory usage
- OS version
- System uptime
- Load average
- Logged in users
- Failed login attempts
server-stats.sh
README.md- Linux operating system
- Bash shell
- Common Linux utilities:
topfreedfpsawkgrep
Most Linux distributions already include these tools by default.
Clone the repository or download the script:
git clone https://github.com/yourusername/server-stats.git
cd server-statsOr simply create the file manually:
nano server-stats.shPaste the script content into the file.
chmod +x server-stats.shRun the script:
./server-stats.shOr:
bash server-stats.sh=========================================
SERVER PERFORMANCE STATISTICS
=========================================
Hostname: ubuntu-server
OS: Ubuntu 24.04 LTS
Uptime: up 2 days, 5 hours
=========================================
CPU USAGE
=========================================
Total CPU Usage: 24%
=========================================
MEMORY USAGE
=========================================
Total Memory: 7980 MB
Used Memory : 3200 MB
Free Memory : 2100 MB
Memory Usage: 40.12%
=========================================
DISK USAGE
=========================================
Total Disk: 100G
Used Disk : 45G
Free Disk : 50G
Disk Usage: 48%
You can extend the script with:
- Network statistics
- Docker container monitoring
- Temperature monitoring
- Running services check
- Email alerts
- Export logs to file
- Real-time monitoring mode
MIT License
Feel free to use, modify, and distribute this project. project url https://roadmap.sh/projects/server-stats