mirror of
https://github.com/m1ngsama/tracker.git
synced 2025-12-24 10:51:43 +00:00
Major improvements and features: - Integrate all monitoring modules (config, alert, logger, temperature) - Add comprehensive error handling throughout codebase - Fix data exporter directory creation issue - Improve process monitor CPU accuracy with proper intervals - Fix logger file handle management New features: - Alert system with configurable thresholds - Automatic logging to daily log files - Data export to JSON/CSV formats - Configuration management via config.json - Temperature monitoring support CI/CD: - Add GitHub Actions workflows for automated testing - Add release workflow for automatic package building - Multi-platform testing (Linux, macOS, Windows) - Python 3.8-3.12 compatibility testing Package distribution: - Add setup.py and pyproject.toml for PyPI distribution - Add MANIFEST.in for proper file inclusion - Add comprehensive CHANGELOG.md - Update README with full documentation Bug fixes: - Fix ResourceWarning in logger - Add ZombieProcess exception handling - Improve error handling in all metric collection methods
137 lines
3.6 KiB
Markdown
137 lines
3.6 KiB
Markdown
# Tracker
|
|
|
|
A comprehensive system monitoring tool for tracking various machine health metrics and performance indicators.
|
|
|
|
[](https://github.com/m1ngsama/tracker/actions/workflows/ci.yml)
|
|
[](https://github.com/m1ngsama/tracker/actions/workflows/release.yml)
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|
## Features
|
|
|
|
- **CPU Monitoring**: Real-time CPU usage percentage tracking
|
|
- **Memory Utilization**: Track memory usage with detailed statistics
|
|
- **Disk I/O Statistics**: Monitor disk usage and I/O operations
|
|
- **Network Traffic Analysis**: Track network bytes sent/received
|
|
- **Process Monitoring**: View top processes by CPU usage
|
|
- **Temperature Sensors**: Monitor system temperatures (if available)
|
|
- **Alert System**: Configurable thresholds for CPU, memory, and disk alerts
|
|
- **Logging**: Automatic logging of all metrics to daily log files
|
|
- **Data Export**: Export monitoring data to JSON or CSV formats
|
|
- **Configuration**: Customizable settings via JSON config file
|
|
|
|
## Installation
|
|
|
|
### From PyPI (coming soon)
|
|
|
|
```bash
|
|
pip install system-tracker
|
|
```
|
|
|
|
### From Source
|
|
|
|
```bash
|
|
git clone https://github.com/m1ngsama/tracker.git
|
|
cd tracker
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Basic usage:
|
|
```bash
|
|
python tracker.py
|
|
```
|
|
|
|
### Continuous monitoring mode:
|
|
```bash
|
|
python tracker.py --continuous --interval 5
|
|
```
|
|
|
|
### Command line options:
|
|
- `-c, --continuous`: Run in continuous monitoring mode
|
|
- `-i, --interval`: Set update interval in seconds (default: 5)
|
|
|
|
## Configuration
|
|
|
|
The `config.json` file allows you to customize the tracker behavior:
|
|
|
|
```json
|
|
{
|
|
"update_interval": 5,
|
|
"display": {
|
|
"show_cpu": true,
|
|
"show_memory": true,
|
|
"show_disk": true,
|
|
"show_network": true,
|
|
"show_processes": true,
|
|
"show_temperatures": true
|
|
},
|
|
"process_limit": 5,
|
|
"alert_thresholds": {
|
|
"cpu_percent": 80,
|
|
"memory_percent": 85,
|
|
"disk_percent": 90
|
|
}
|
|
}
|
|
```
|
|
|
|
## Output
|
|
|
|
The tracker provides:
|
|
- **Console Output**: Real-time metrics displayed in the terminal
|
|
- **Log Files**: Daily logs stored in `logs/` directory
|
|
- **Alerts**: Visual and logged warnings when thresholds are exceeded
|
|
- **Export Data**: Optional data export to `exports/` directory
|
|
|
|
## Requirements
|
|
|
|
- Python 3.8+
|
|
- psutil
|
|
- GPUtil (for GPU monitoring)
|
|
- requests
|
|
|
|
## Development
|
|
|
|
### Running Tests
|
|
|
|
```bash
|
|
python test_tracker.py
|
|
```
|
|
|
|
### Project Structure
|
|
|
|
```
|
|
tracker/
|
|
├── tracker.py # Main application
|
|
├── process_monitor.py # Process monitoring module
|
|
├── temperature_monitor.py # Temperature sensors module
|
|
├── config_manager.py # Configuration management
|
|
├── alert_system.py # Alert and threshold management
|
|
├── logger.py # Logging functionality
|
|
├── data_exporter.py # Data export utilities
|
|
├── config.json # Configuration file
|
|
└── requirements.txt # Python dependencies
|
|
```
|
|
|
|
## CI/CD
|
|
|
|
This project uses GitHub Actions for:
|
|
- **Continuous Integration**: Automated testing on multiple OS and Python versions
|
|
- **Automated Releases**: Automatic package building and release creation on version tags
|
|
- **Code Quality**: Linting and syntax checking
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
|
## License
|
|
|
|
MIT License - see [LICENSE](LICENSE) file for details
|
|
|
|
## Author
|
|
|
|
m1ngsama
|
|
|
|
## Acknowledgments
|
|
|
|
- Built with [psutil](https://github.com/giampaolo/psutil) for cross-platform system monitoring
|