Skip to main content

A beautiful terminal-based system monitoring tool

Project description

SysMon ๐Ÿ“Š

A beautiful, lightweight system monitoring tool for your terminal

Version Python License Platform


๐Ÿ“ธ Screenshots

Main Dashboard

SysMon Dashboard

Snapshot View

Snapshot View

History View

History View


โœจ Features

  • ๐ŸŽจ Beautiful Terminal UI - Rich colors, progress bars, and organized layouts
  • โšก Real-time Monitoring - Live dashboard with auto-refresh
  • ๐Ÿ’พ Data Persistence - Store snapshots in JSON or SQLite
  • ๐Ÿ“Š Historical Data - View and analyze past system metrics
  • ๐ŸŽฏ Top Processes - Track resource-hungry applications
  • ๐Ÿ”ง Highly Configurable - YAML-based configuration with sensible defaults
  • ๐Ÿ“ฆ Multiple Export Formats - JSON output for scripting and automation
  • ๐Ÿชต Smart Logging - Rotating logs with configurable levels
  • ๐Ÿ–ฅ๏ธ Cross-Platform - Works on Windows, macOS, and Linux
  • ๐Ÿš€ Lightweight - Minimal resource usage and dependencies

๐ŸŽฌ Demo

Demo


๐Ÿ“‹ Table of Contents


๐Ÿš€ Installation

Windows

# Clone the repository
git clone https://github.com/OR-6/sysmon.git
cd sysmon

# Run the installation script
.\install.ps1

# Optional: Add to PATH for 'sysmon' command
.\install.ps1 -AddToPath

Linux / macOS

# Clone the repository
git clone https://github.com/OR-6/sysmon.git
cd sysmon

# Run the installation script
bash install.sh

# Optional: Add to system PATH
sudo ln -s $(pwd)/sysmon /usr/local/bin/sysmon

From PyPI (Coming Soon)

pip install sysmon

Requirements

  • Python 3.8 or higher
  • pip (Python package manager)
  • Works on Windows, macOS, and Linux

๐ŸŽฏ Quick Start

# Windows
python run.py monitor

# Linux/Mac
./sysmon monitor

# All platforms
python -m sysmon.cli monitor

That's it! Press Ctrl+C to exit.


๐Ÿ“– Usage

Monitor Dashboard

Start the live monitoring dashboard:

# Default settings (2 second refresh)
sysmon monitor

# Custom refresh interval
sysmon monitor -i 5

# Show per-CPU core usage
sysmon monitor --per-cpu

# Hide process list for cleaner view
sysmon monitor --no-processes

Controls:

  • Ctrl+C - Exit the dashboard

Take Snapshots

Capture a single system snapshot:

# Simple snapshot
sysmon snapshot

# JSON output (great for scripts)
sysmon monitor --json > snapshot.json

View History

View stored historical data (requires storage to be enabled):

# Show last 10 snapshots
sysmon history

# Show last 50 snapshots
sysmon history -n 50

# Export as JSON
sysmon history --json > history.json

Configuration

Manage your settings:

# View current configuration
sysmon config show

# Show config file location
sysmon config path

# Change settings
sysmon config set display.refresh_interval 5
sysmon config set storage.enabled true
sysmon config set storage.backend sqlite

# Reset to defaults
sysmon config reset

Export Data

Export your stored snapshots:

# Export to JSON file
sysmon export snapshots.json

# Export to specific location
sysmon export ~/backups/system-data-$(date +%Y%m%d).json

Clear Data

Remove all stored snapshots:

sysmon clear

โš™๏ธ Configuration

Configuration is stored in ~/.config/sysmon/config.yaml

Default Configuration

display:
  refresh_interval: 2        # Refresh every N seconds
  show_per_cpu: false        # Show individual CPU cores
  show_processes: true       # Display top processes
  process_count: 5           # Number of processes to show
  progress_bar_width: 30     # Width of progress bars

storage:
  enabled: false             # Enable data persistence
  backend: json              # 'json' or 'sqlite'
  path: ~/.local/share/sysmon/data
  max_records: 1000          # Keep last N snapshots

logging:
  enabled: true              # Enable logging
  level: INFO                # DEBUG, INFO, WARNING, ERROR
  path: ~/.local/share/sysmon/logs
  max_size_mb: 10           # Max log file size
  backup_count: 3           # Number of backup files

Configuration Examples

Enable data storage:

sysmon config set storage.enabled true
sysmon config set storage.backend sqlite

Show more processes:

sysmon config set display.process_count 10

Change refresh rate:

sysmon config set display.refresh_interval 1

Enable per-CPU monitoring:

sysmon config set display.show_per_cpu true

๐Ÿ“š Commands Reference

Global Options

sysmon --version              # Show version
sysmon --help                 # Show help

Monitor Command

sysmon monitor [OPTIONS]

Options:
  -i, --interval INTEGER    Refresh interval in seconds
  --per-cpu                 Show per-CPU core usage
  --no-processes            Hide process list
  --json                    Output as JSON (single snapshot)
  --help                    Show help

Snapshot Command

sysmon snapshot              # Take a single snapshot

History Command

sysmon history [OPTIONS]

Options:
  -n, --limit INTEGER       Number of snapshots to show (default: 10)
  --json                    Output as JSON
  --help                    Show help

Config Commands

sysmon config show           # Display current configuration
sysmon config path           # Show config file location
sysmon config set KEY VALUE  # Set a configuration value
sysmon config reset          # Reset to defaults

Export Command

sysmon export OUTPUT_PATH    # Export stored data

Clear Command

sysmon clear                 # Clear all stored data

๐Ÿ› ๏ธ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/OR-6/sysmon.git
cd sysmon

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
.\venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate

# Install in development mode with dev dependencies
pip install -e ".[dev]"

Run Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=sysmon tests/

# Run specific test file
pytest tests/test_core.py

Code Quality

# Format code
black src/

# Check style
flake8 src/

# Type checking
mypy src/

Building Distribution

# Build package
python -m build

# Install locally
pip install dist/sysmon-0.1.0-py3-none-any.whl

๐Ÿ“ Project Structure

sysmon/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ sysmon/
โ”‚       โ”œโ”€โ”€ __init__.py       # Package initialization
โ”‚       โ”œโ”€โ”€ cli.py            # Command-line interface (Click)
โ”‚       โ”œโ”€โ”€ core.py           # System monitoring logic
โ”‚       โ”œโ”€โ”€ display.py        # Rich terminal display
โ”‚       โ”œโ”€โ”€ storage.py        # Data persistence (JSON/SQLite)
โ”‚       โ”œโ”€โ”€ config.py         # Configuration management
โ”‚       โ”œโ”€โ”€ models.py         # Pydantic data models
โ”‚       โ””โ”€โ”€ utils.py          # Helper functions
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ test_core.py          # Unit tests
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ config.example.yaml   # Example configuration
โ”œโ”€โ”€ screenshots/              # Screenshots for README
โ”œโ”€โ”€ run.py                    # Cross-platform launcher
โ”œโ”€โ”€ sysmon                    # Unix/Linux/Mac launcher
โ”œโ”€โ”€ sysmon.bat                # Windows batch launcher
โ”œโ”€โ”€ install.sh                # Unix installation script
โ”œโ”€โ”€ install.ps1               # Windows installation script
โ”œโ”€โ”€ pyproject.toml            # Project metadata and dependencies
โ”œโ”€โ”€ setup.py                  # Setup configuration
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ LICENSE                   # MIT License
โ””โ”€โ”€ .gitignore               # Git ignore rules

โ“ FAQ

How do I enable data storage?

sysmon config set storage.enabled true

Can I export data to CSV?

Currently, export is JSON only. You can convert JSON to CSV using tools like jq or Python:

# Using jq (if installed)
sysmon history --json | jq -r '.[] | [.timestamp, .cpu.percent, .memory.percent] | @csv'

Why is my CPU showing 0%?

Make sure you're not running SysMon on a very fast refresh interval. CPU measurement needs at least 1 second to be accurate.

How do I uninstall?

pip uninstall sysmon

Does this work over SSH?

Yes! SysMon works perfectly over SSH connections as it's a pure terminal application.

Can I monitor remote systems?

Not directly. SysMon monitors the local system where it's running. For remote monitoring, SSH into the remote system and run SysMon there.

What's the difference between JSON and SQLite storage?

  • JSON: Simple, human-readable, easy to backup
  • SQLite: More efficient for large datasets, faster queries

How much disk space does storage use?

Each snapshot is approximately 1-2 KB. With default settings (1000 max records), you'll use about 1-2 MB.


๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

Reporting Bugs

  1. Check if the bug has already been reported in Issues
  2. If not, create a new issue with:
    • Clear description of the bug
    • Steps to reproduce
    • Expected vs actual behavior
    • Your system info (OS, Python version)

Suggesting Features

Open an issue with the enhancement label describing:

  • The feature you'd like to see
  • Why it would be useful
  • How it might work

Pull Requests

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Ensure all tests pass (pytest)
  6. Format your code (black src/)
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Code Guidelines

  • Follow PEP 8 style guide
  • Add type hints to all functions
  • Write docstrings for public APIs
  • Include tests for new features
  • Update documentation as needed

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • psutil - Cross-platform system and process utilities
  • Rich - Beautiful terminal formatting
  • Click - Elegant CLI framework
  • Pydantic - Data validation using Python type annotations

Inspiration

Inspired by tools like:

  • htop - Interactive process viewer
  • btop - Resource monitor
  • glances - Cross-platform monitoring tool

๐Ÿ—บ๏ธ Roadmap

Version 0.2.0

  • Alert system with threshold notifications
  • Custom dashboard layouts
  • Network interface selection
  • Disk I/O monitoring

Version 0.3.0

  • GPU monitoring support (NVIDIA, AMD)
  • Docker container stats
  • Temperature sensors
  • Battery status (laptops)

Version 1.0.0

  • Web UI option
  • Prometheus exporter
  • Plugin system
  • Remote monitoring capability

๐Ÿ“Š Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests


๐Ÿ“ง Contact


Made with โค๏ธ by developers, for developers

If you find this tool useful, consider giving it a โญ on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sysmonitor-0.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sysmonitor-0.1.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file sysmonitor-0.1.0.tar.gz.

File metadata

  • Download URL: sysmonitor-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for sysmonitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abc83f1b279dfce9c6589682bded7da22b90cd2694a4d0a4816c676c3b790adc
MD5 046c6f21728d6ce4ff3839eae14a957f
BLAKE2b-256 e8196e8b916d1f919a326f99a277e21ae1f5f3230990619bbf994ca8faa66673

See more details on using hashes here.

File details

Details for the file sysmonitor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sysmonitor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for sysmonitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f36a743e41f0e3883b8d4b9ff82a5858c0009355e77e6833c598d12294c2cf1
MD5 633295ca6ec32dafb9c0bbdd59a857e6
BLAKE2b-256 e7eab048648e5bf7a9d57d399716c604fd9aa7e76d9be38258c0db26994fb043

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page