A lightweight and interactive terminal-based system monitoring tool written in Go. Provides real-time metrics for CPU, memory, disk, network, and processes—ideal for quick CLI insights or embedding into your DevOps tooling.
- Overview
- Features
- Tech & Requirements
- Installation & Build
- Usage Examples
- Code Structure
- Under the Hood
- Future Enhancements
- Contributing
- License
This CLI tool functions like a lightweight top or htop, showing essential system stats—CPU load, memory usage, disk I/O, network throughput, and running processes—all in a clean terminal UI. It uses Go libraries to achieve performance and portability. :contentReference[oaicite:1]{index=1}
- 🧠 Real-time monitoring of:
- CPU usage (per core & total)
- RAM and swap usage
- Disk read/write rates
- Network bandwidth
- Live process list, sortable by CPU/memory
- 🎨 Interactive terminal UI—refresh rate and keybindings
- 🔁 Minimal dependencies—built using Go’s standard libraries and pprof-compatible design
- 🌍 Cross-platform support (Linux/macOS; Windows experimental)
- Go 1.18+ (modules enabled)
- Libraries:
gopsutilfor system metrics (CPU, memory, disk, network)termboxortview(or similar) for interactive TUI
- No external vendor dependencies
git clone https://github.com/MisaghMomeniB/System-Monitor-Go.git
cd System-Monitor-Go
# Build the CLI
go build -o sysmon main.go
# Or run directly:
go run main.goRun the monitor:
./sysmonExample key interactions:
- Press
qorCtrl+Cto exit - Use arrow keys to scroll through processes
- Press
c,m, orpto sort by CPU, memory, or PID respectively (Keybindings may vary; check UI header)
System-Monitor-Go/
├── main.go # Entrypoint + TUI loops
├── metrics.go # CPU, memory, disk, network retrieval
├── ui.go # Terminal UI rendering & input handling
└── utils.go # Helper functions (formatting, sorting)
- Uses
gopsutilto retrieve system statistics efficiently - Renders interactive UI using a light terminal library (e.g.,
tview)—redrawing every second - Shows process lists with sorting/filtering enabled
- Can expose internal metrics for integration with Prometheus or OpenTelemetry ([omgubuntu.co.uk][1], [tecmint.com][2], [en.wikipedia.org][3], [uptrace.dev][4], [github.com][5], [dev.to][6], [en.wikipedia.org][7], [medium.com][8])
- ✅ Export system metrics to Prometheus/Grafana
- 🖼️ Add customizable widgets & dashboards
- ⏱️ Enable real-time alerts (e.g., high CPU or memory usage)
- 🧭 Add command-line flags to filter top processes, set refresh intervals
- 🌐 Build a web or desktop dashboard frontend
Contributions are welcome! Consider adding:
- More metrics (e.g., GPU, temperature)
- Cross-platform support
- Persistent data/snapshots
- Modular plugin architecture
To contribute:
- Fork the project
- Create a
feature/...branch - Submit a PR with your changes
Licensed under the MIT License — see LICENSE for details.