Skip to content

Total CPU usage Total memory usage (Free vs Used including percentage) Total disk usage (Free vs Used including percentage) Top 5 processes by CPU usage Top 5 processes by memory usage

Notifications You must be signed in to change notification settings

ankitsyadav/Server-Performance-Script-Project-Devops-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

Server Performance Stats Script

A simple Bash script to analyze and display basic server performance statistics on any Linux machine. This project helps you understand how to monitor system health using standard Linux commands.

πŸ“Œ Project Overview

The goal of this project is to build a shell script (server-stats.sh) that provides a quick overview of a server’s current performance. It is useful for basic debugging, learning Linux system monitoring, and understanding resource utilization.

πŸš€ Features

The script displays the following system statistics:

βœ… Core Requirements

Total CPU usage

Total Memory usage

Used vs Free memory

Percentage usage

Total Disk usage

Used vs Free disk space

Percentage usage

Top 5 processes by CPU usage

Top 5 processes by Memory usage

⭐ Optional / Stretch Features

Operating System version

System uptime

Load average

Logged-in users

Failed login attempts (if available)

πŸ› οΈ Technologies Used

Bash / Shell Scripting

Standard Linux utilities:

top

free

df

ps

awk

grep

uptime

uname

No external dependencies are required.

πŸ“‚ Project Structure . β”œβ”€β”€ server-stats.sh β”œβ”€β”€ README.md

βš™οΈ How to Run the Script

Clone the repository:

git clone https://github.com/your-username/server-performance-stats.git cd server-performance-stats

Give execute permission:

chmod +x server-stats.sh

Run the script:

./server-stats.sh

πŸ“Š Sample Output ===== Server Performance Stats =====

CPU Usage: 23%

Memory Usage: Used: 3.2 GB / 8 GB (40%) Free: 4.8 GB

Disk Usage: /dev/sda1 - Used: 45% | Free: 55%

Top 5 Processes by CPU Usage: PID COMMAND CPU% 1234 node 18.2 ...

Top 5 Processes by Memory Usage: PID COMMAND MEM% 5678 chrome 12.4 ...

🎯 Learning Outcomes

By completing this project, you will learn:

How to inspect system performance using Linux CLI tools

How to parse command output using awk and grep

How to write readable and maintainable shell scripts

Basics of server monitoring and troubleshooting

🧩 Future Improvements

Add colored output for better readability

Export stats to a log file

Add alert thresholds (CPU/memory > X%)

Support for macOS (limited)

🀝 Contributing

Contributions are welcome. Feel free to fork the repository, create a feature branch, and submit a pull request.

πŸ“œ License

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

πŸ‘€ Author

Ankit Singh Yadav Backend Developer | Node.js | System Design Feel free to connect and provide feedback.

About

Total CPU usage Total memory usage (Free vs Used including percentage) Total disk usage (Free vs Used including percentage) Top 5 processes by CPU usage Top 5 processes by memory usage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published