Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Server Stats Script

A simple Bash script to analyze basic Linux server performance statistics.

Features

  • 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

File Structure

server-stats.sh
README.md

Requirements

  • Linux operating system
  • Bash shell
  • Common Linux utilities:
    • top
    • free
    • df
    • ps
    • awk
    • grep

Most Linux distributions already include these tools by default.


Installation

Clone the repository or download the script:

git clone https://github.com/yourusername/server-stats.git
cd server-stats

Or simply create the file manually:

nano server-stats.sh

Paste the script content into the file.


Make Script Executable

chmod +x server-stats.sh

Usage

Run the script:

./server-stats.sh

Or:

bash server-stats.sh

Example Output

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

Optional Improvements

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

License

MIT License

Feel free to use, modify, and distribute this project. project url https://roadmap.sh/projects/server-stats

About

A simple Bash script to analyze basic Linux server performance statistics.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages