Intelligent disk diagnostics and storage observability for SREs
Project description
๐ฉบ dxcli โ The Disk Doctor
Stop firefighting. Start predicting.
Replace your 45-minute disk investigation with a 30-second diagnosis.
The Problem
It's 2 AM. PagerDuty fires. Your production server is at 98% disk.
You SSH in and start the ritual:
df -h # okay, it's /var
du -sh /var/* # narrowing down...
du -sh /var/log/* | sort -h # getting warmer...
find /var/log -size +100M # which file?
lsof | grep deleted # which process?!
45 minutes later, you've found the culprit โ a runaway log file from a service nobody knew was deployed. You delete it, go back to sleep, and it happens again next week.
There is a better way.
The Solution
dxcli diagnose /var
๐ฉบ Disk Doctor โ Diagnosis Report
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐จ LOG BOMB DETECTED
/var/log/payments/transaction.log โ 14.2 GB
โณ Written by: payments-service (PID 18423)
โณ Last rotation: Never
โณ Prescription: Add logrotate config immediately
โ ๏ธ STALE DATA
/var/cache/thumbnails โ 8.7 GB
โณ Last accessed: 94 days ago
โณ Prescription: Safe to archive or delete
๐ GROWTH FORECAST
At current rate, /var fills in 6 hours 12 minutes
Growth is ACCELERATING (+340% vs last week)
30 seconds. Exact culprit. Exact prescription.
Features
๐ dxcli diagnose โ Intelligent Diagnosis
Not just file sizes. It tells you why your disk is filling:
- Log Bomb detection โ unrotated logs growing out of control
- Stale file identification โ large files untouched for months
- Process attribution โ exactly which PID is writing to a path
๐ dxcli predict โ Time-to-Full Forecasting
Linear regression on historical snapshots stored locally. Tells you:
- When your disk will be full (hours, days, weeks)
- Whether growth is stable or accelerating
- Which directories are the fastest-growing threats
๐ฅ๏ธ dxcli dash โ Real-time TUI Dashboard
A full terminal UI with live sparklines, anomaly alerts, and interactive process maps. No browser required.
โโ Disk Overview โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ /var [โโโโโโโโโโโโโโโโโโโโโโโโ] 84% โ FAST โ
โ /home [โโโโโโโโโโโโโโโโโโโโโโโโ] 34% โ STABLEโ
โ /tmp [โโโโโโโโโโโโโโโโโโโโโโโโ] 12% โ SLOW โ
โ โ
โ ๐จ ANOMALY: Log Bomb in /var/log/payments โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ญ dxcli serve โ The Sentinel (Prometheus-compatible)
Run as a background daemon. Exports /metrics for Grafana integration. Plug dxcli's intelligence directly into your existing observability stack.
Installation
pip install diskrx
That's it. No config files. No daemons required to get started.
Quickstart
# Diagnose a path right now
dxcli diagnose /var
# Predict when your root partition fills up
dxcli predict /
# Open the live TUI dashboard
dxcli dash
# Start the Prometheus metrics server
dxcli serve --port 8000
How It Works
dxcli stores lightweight disk snapshots in a local SQLite database (~/.dx/history.db). Over time, it builds a picture of your disk's growth patterns and uses linear regression to forecast the future.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ dxcli Architecture โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโโโโโค
โ collectors/ โ analyzers/ โ store/ โ outputs/ โ
โ โ โ โ โ
โ Raw OS data โ The "Brain" โ SQLite DB โ Rich / TUI โ
โ psutil โ Growth rate โ Snapshots โ Prometheus โ
โ File scans โ Anomaly โ History โ HTTP API โ
โ PID mapping โ detection โ โ โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
Who This Is For
- SREs who are tired of getting paged for disk full alerts they could have predicted
- DevOps engineers who want disk intelligence in their Grafana dashboards
- Platform engineers who need to attribute storage costs to specific services
- Anyone who has typed
du -sh * | sort -hmore than once this month
Integrations
Grafana / Prometheus
Add to your prometheus.yml:
scrape_configs:
- job_name: 'diskrx'
static_configs:
- targets: ['localhost:8000']
Have a feature request? Open an issue.
Contributing
Contributions are welcome. Please read the contributing guide before submitting a PR.
git clone https://github.com/Seshadri724/diskrx
cd dxcli
python -m venv venv && source venv/bin/activate
pip install -e ".[test]"
pytest tests/ -v
License
MIT โ see LICENSE for details.
Built for SREs, by someone who got paged one too many times at 2 AM.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diskrx-0.1.1.tar.gz.
File metadata
- Download URL: diskrx-0.1.1.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06aae1b408feaaaf41cf8613d58d6e906f62712023ba086e107f7659396719de
|
|
| MD5 |
aa171a85cb781cc89ae9b24dd98bc09b
|
|
| BLAKE2b-256 |
7a32fcc3d1714d9fb8e2fb908e363388d87ac659dbfc46fcaff2e6412edad640
|
File details
Details for the file diskrx-0.1.1-py3-none-any.whl.
File metadata
- Download URL: diskrx-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64b881bab2c34fc77e864e11d22268237f651f750853d72d6d1a605487a5f5b1
|
|
| MD5 |
f807fd37eab2bc6103a45c747dbb13ee
|
|
| BLAKE2b-256 |
f65959c4e510712f00d4ff65256e7491d5123876203c66ce23399c64b314cfb2
|