system-monitor-0.2.0 is not a library.
System Monitor
A powerful, configurable system monitoring tool built in Rust that provides real-time insights into your system's performance.
Features
- Real-time Monitoring: CPU, memory, disk, and process monitoring
- Color-coded Progress Bars: Visual representation of system usage
- Configurable Thresholds: Custom warning and critical levels
- Alert System: Automatic alerts with logging when thresholds are exceeded
- Multiple Display Modes: Continuous monitoring, one-time summary, or single run
- Professional Output: Clean, organized display with timestamps
- Cross-platform: Works on Linux, macOS, and Windows
Installation
Prerequisites
- Rust 1.70 or later
- Cargo (comes with Rust)
Build from Source
Run Directly
Usage
Basic Commands
# Default continuous monitoring (30-second intervals)
# Generate configuration file
# One-time system summary
# Explicit monitor mode
# Run once and exit
# Custom config file
# Help and version
Configuration
Generate a configuration file to customize thresholds and display options:
This creates a config.toml
file with the following structure:
[]
= 30
= true
= "system_monitor.log"
[]
= true
= true
= true
= 10
[]
= 70.0
= 90.0
= 70.0
= 90.0
= 70.0
= 90.0
= 70.0
= 90.0
[]
= false
= false
= false
Sample Output
================================================
System Monitor - 2025-08-08 15:30:45
================================================
CPU INFORMATION
Overall Usage: [####----------------] 21.5%
Per Core:
Core 0: [########------------] 40.9%
Core 1: [#######-------------] 38.1%
Core 2: [######--------------] 33.5%
Core 3: [######--------------] 30.5%
MEMORY INFORMATION
RAM Usage: [################----] 80.2%
Total: 8.0 GB
Used: 6.4 GB
Available: 1.6 GB
DISK INFORMATION
Mount: / [##############------] 73.3%
Total: 460.4 GB | Used: 337.6 GB | Free: 122.9 GB
TOP PROCESSES
PID NAME CPU% MEMORY
--------------------------------------------------
1234 chrome 15.2% 512.3MB
5678 firefox 8.1% 256.1MB
SYSTEM INFORMATION
OS: Darwin
Hostname: MacBookAir
Uptime: 1647h 1m
Load Avg: 2.56, 3.57, 3.71
Press Ctrl+C to exit...
Color Coding
- Green: Normal usage (below warning threshold)
- Yellow: Warning level (above warning, below critical)
- Red: Critical level (above critical threshold)
Alert System
When thresholds are exceeded, alerts are:
- Logged to console
- Written to log file (if enabled)
- Can trigger desktop notifications (configurable)
Dependencies
sysinfo
- System information gatheringclap
- Command-line argument parsingserde
&toml
- Configuration file handlingcolored
- Terminal color outputchrono
- Date and time handlinglog
&env_logger
- Logging functionalitycrossterm
- Cross-platform terminal manipulation
Development
Project Structure
system-monitor/
├── src/
│ └── main.rs # Main application code
├── Cargo.toml # Project dependencies
├── config.toml # Configuration file (generated)
├── README.md # This file
└── .gitignore # Git ignore rules
Building
# Debug build
# Release build (optimized)
# Run tests
# Check code without building
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Roadmap
- Network bandwidth monitoring
- Docker container monitoring
- Web dashboard interface
- Email alert notifications
- Historical data logging
- Plugin system for custom metrics
- JSON/CSV export functionality
Troubleshooting
Common Issues
High memory usage alerts on macOS: This is often normal due to macOS memory management. Adjust thresholds in config.toml if needed.
Permission denied errors: Some system information requires elevated privileges on certain platforms.
Missing dependencies: Ensure you have the latest Rust toolchain installed.
Acknowledgments
- Built with sysinfo for cross-platform system information
- Inspired by traditional monitoring tools like
htop
andtop
- Thanks to the Rust community for excellent crates and documentation