Skip to main content

A lightweight server monitoring CLI tool

Project description

monitor-bt

A lightweight server monitoring CLI tool built with Python. Monitor CPU, memory, disk, network, processes, and more — all from your terminal.

Installation

pip install monitor-bt

Usage

System Overview

monitor-bt status
                 Server Status
+---------------------------------------------+
| Metric       | Value                        |
|--------------+------------------------------|
| CPU Usage    | 23.4%                        |
| CPU Cores    | 8                            |
| RAM Usage    | 61.2%                        |
| RAM Total    | 15.9 GB                      |
| RAM Used     | 9.7 GB                       |
| RAM Free     | 6.2 GB                       |
| Disk (C:\)   | 54.3%  [121.0 GB / 223.0 GB]|
| Network Down | 1.2 MB/s                     |
| Network Up   | 256.0 KB/s                   |
| Uptime       | 3d 14h 22m                   |
| Processes    | 214                          |
+---------------------------------------------+

CPU Details

monitor-bt cpu

Shows overall usage, per-core breakdown, core count, and frequency.

Memory Details

monitor-bt memory

Shows total, used, free, available RAM, and swap usage.

Disk Details

monitor-bt disk

Lists all disk partitions with total, used, free, and usage percentage.

Check a specific path:

monitor-bt disk --path /home

Network Statistics

monitor-bt network

Shows total data transferred, current download/upload speed, packet counts, and IP addresses per interface.

Top Processes

monitor-bt processes
monitor-bt processes --top 20

Lists processes sorted by memory usage, similar to Task Manager.

Kill a Process

monitor-bt kill 3425

Kills the process with the given PID.

System Uptime

monitor-bt uptime

System Information

monitor-bt sysinfo

Shows OS, hostname, Python version, CPU model, core count, and temperature sensors.

Live Dashboard

monitor-bt watch
monitor-bt watch --interval 1

Real-time refreshing dashboard showing CPU, RAM, disk, and network. Press Ctrl+C to stop.

Docker Containers

monitor-bt docker

Lists all Docker containers with their status and image.

View Logs

monitor-bt logs
monitor-bt logs --lines 50

Reads recent entries from today's monitoring log.

Export Metrics

monitor-bt export report.json
monitor-bt export report.csv

Exports current system metrics to a JSON or CSV file.

Project Structure

monitor-bt/
├── app/
│   ├── __init__.py
│   ├── main.py                  # CLI entry point (typer app)
│   ├── commands/                # One file per CLI command
│   │   ├── status.py
│   │   ├── cpu.py
│   │   ├── memory.py
│   │   ├── disk.py
│   │   ├── network.py
│   │   ├── processes.py
│   │   ├── kill.py
│   │   ├── uptime.py
│   │   ├── watch.py
│   │   ├── docker_cmd.py
│   │   ├── logs.py
│   │   └── export_cmd.py
│   ├── collectors/              # Data collection (psutil wrappers)
│   │   ├── cpu.py
│   │   ├── memory.py
│   │   ├── disk.py
│   │   ├── network.py
│   │   ├── process.py
│   │   └── system.py
│   ├── services/                # Business logic
│   │   ├── monitoring.py        # Parallel collection with ThreadPoolExecutor
│   │   ├── alerts.py            # Threshold-based alerts
│   │   └── logger.py            # File-based metric logging
│   └── utils/
│       ├── display.py           # Rich tables, progress bars, panels
│       └── config.py            # Default thresholds and paths
├── logs/                        # Auto-generated daily log files
├── tests/                       # Unit tests with mocked psutil
├── pyproject.toml
└── README.md

Architecture

CLI Commands (typer)
       │
       ▼
  Services Layer
  ├── monitoring.py   ← ThreadPoolExecutor runs collectors in parallel
  ├── alerts.py       ← Checks metrics against thresholds
  └── logger.py       ← Writes metrics to daily log files
       │
       ▼
  Collectors (psutil)
  ├── cpu.py
  ├── memory.py
  ├── disk.py
  ├── network.py
  ├── process.py
  └── system.py

Development

Install in editable mode

git clone https://github.com/yourusername/monitor-bt.git
cd monitor-bt
pip install -e ".[dev]"

Run tests

pytest tests/ -v

Run with coverage

pytest tests/ --cov=app

Dependencies

Library Purpose
psutil System metrics (CPU, RAM, disk, etc)
rich Terminal UI (tables, panels, colors)
typer CLI framework

License

MIT

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

monitor_bt-0.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

monitor_bt-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for monitor_bt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44821993cf9353ea297091971c1e69cbdfe45406a5b9802be6bf3e967d8b8c2a
MD5 4693a8deddd1c01e126b94370e582e9e
BLAKE2b-256 62b6991be2c6d0752cb6c56bd97aeef8b18f4934744d0348506ba18c688727ed

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for monitor_bt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 007e0d680dac5d048d7b9687780f918d2fec7d9233be80bb1f919bff99c4a729
MD5 b57033b93643c5f70c87c012efd7c98c
BLAKE2b-256 73f9580954c77f03353ef3eedc26f069169c060b1e94b5355decd09c778a9652

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