๐ฉบ VPS Vital Signs Monitor โ read-only SSH diagnostics with root-cause analysis
Project description
Connect to any Linux VPS with your root credentials and get an instant, full-colour report on what's going wrong. vitals-vps acts as an automated system administrator, identifying CPU spikes, active brute-force attacks, memory pressure, disk exhaustion, and zombie processesโand gives you the exact commands to fix them.
โ 100% Safe & Read-Only: Every command is strictly filtered through a safety blocklist. No files are created, modified, or deleted. No services are restarted.
๐ Installation
Install globally via pip:
pip install vitals-vps
(Requires Python 3.8+, paramiko, and rich)
๐ป Usage
You can use vitals-vps straight from your terminal or programmatically via Python.
Terminal CLI
# Prompt for password (recommended)
vitals 192.168.1.10 --ask-pass
# Use an SSH key instead of a password
vitals 192.168.1.10 --key ~/.ssh/id_rsa
# Non-standard port or user
vitals 192.168.1.10 --port 2222 --user ubuntu --ask-pass
# Verbose mode: Also show raw process lists, log excerpts, and port tables
vitals 192.168.1.10 --ask-pass --verbose
Python API (Jupyter / Scripts / Google Colab)
Perfect for integrating into automated monitoring dashboards or running from Jupyter Notebooks.
import vitals
# Print the full styled report to your screen
vitals.info("192.168.1.10", password="mypassword")
# Use key-based authentication
vitals.info("192.168.1.10", user="ubuntu", key="~/.ssh/id_rsa")
# Silent execution: Returns a list of Finding objects for automation
findings = vitals.scan("192.168.1.10", password="mypassword")
critical_issues = [f for f in findings if f.severity.value == "critical"]
for issue in critical_issues:
print(f"Alert: {issue.title}")
๐ What It Checks
| Category | Diagnostic Targets |
|---|---|
| โก CPU | Load average vs core count, CPU utilization %, I/O wait (iowait), runaway background processes. |
| ๐ง Memory | RAM allocation, available memory, swap usage, and recent OOM (Out-of-Memory) killer events. |
| ๐ฝ Disk | Partitions > 80% full, inode exhaustion, largest hidden directories, disk I/O bottlenecks. |
| ๐ Network | Connection floods, top remote IPs, TIME_WAIT socket buildup, and open listening ports. |
| ๐ก๏ธ Security | SSH brute-force attacks, top attacking IPs, fail2ban status, firewall presence, active sessions, and unauthorized UID-0 accounts. |
| โ๏ธ Processes | Zombie processes, D-state (I/O-blocked) processes, and failed systemd services. |
| ๐ Logs | dmesg kernel errors, systemd journal errors, and web server / database error logs. |
๐ Sample Output
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ System Identity โ
โ Host my-server.example.com โ
โ OS Ubuntu 22.04.3 LTS โ
โ Kernel 5.15.0-89-generic โ
โ Uptime up 12 days, 4 hours โ
โ CPU Intel Xeon E5-2670 v2 โ
โ Cores 4 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Diagnostic Scorecard โ
โ Category Status Findings โ
โ CPU โ CRITICAL 1 issue(s) โ
โ Memory โ CRITICAL 2 issue(s) โ
โ Disk โ
OK All clear โ
โ Network โ WARNING 1 issue(s) โ
โ Security โ CRITICAL 2 issue(s) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโ CPU โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ด Extreme load average: 8.4 on 4 core(s)
๐ 1-min load=8.4, 5-min=6.2, 15-min=4.1. With 4 cores,
the system has ~2x more runnable work than it can handle.
๐ก What to do: Identify the runaway process(es)โฆ
๐ Commands:
ps aux --sort=-%cpu | head -15
top -b -n1 | head -20
โโ Security โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ด Active brute-force attack: 47,312 SSH login failures
๐ 47,312 failed SSH login attempts found in auth log.
๐ก What to do:
1. Install fail2ban immediately to auto-ban attackers.
2. Change SSH to a non-standard port (e.g. 2222).
3. Disable password login โ use SSH keys only.
๐ Commands:
apt install fail2ban -y
systemctl enable --now fail2ban
๐ Safety Guarantees
- Hardware Level Guard: Every SSH command runs through a rigorous blocklist filter. If a command string contains anything resembling a write, delete, kill, or install operation, it immediately raises a
ValueErrorbefore sending it to your server. - No Artifacts Left Behind: No temporary data is written to disk. The tool runs entirely in memory, prints the results, and cleanly closes the SSH connection.
- Secure Key Management: The SSH client leverages
AutoAddPolicyfor seamless connections, but strictly logs host keys to prevent man-in-the-middle attacks.
๐บ๏ธ Roadmap
-
--output jsonflag for piping directly into CI/CD or alerting pipelines -
--watchmode: re-scan every N seconds for live monitoring - HTML report export for client delivery
- Docker container support (scan via
docker exec) - Baseline comparison mode: diff current findings against a historical baseline
โ๏ธ License
This project is licensed under the MIT License.
You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software in both private and commercial environments, provided that the original copyright notice and permission notice are included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
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 vitals_vps-0.2.8.tar.gz.
File metadata
- Download URL: vitals_vps-0.2.8.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9cb9876ba02bda9d3163120b83d7c07932130cd0050735f588835fa412ec9ae
|
|
| MD5 |
845009332a56942bd9634d93cb4d962b
|
|
| BLAKE2b-256 |
d5f68eb711378e8c3f147c9cadf120a60ba409f96dad56dd49b716abf7d30db1
|
File details
Details for the file vitals_vps-0.2.8-py3-none-any.whl.
File metadata
- Download URL: vitals_vps-0.2.8-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66754ef02ff88dad55ba87f9a1943673f126709a8e21aa03e14b9d2cb5535163
|
|
| MD5 |
47f49a581af134c2bf5ff5e1281ade36
|
|
| BLAKE2b-256 |
4bd42f696f463cc07de30d0a65b747aabffe37fda24bf6bb33601c0df567a651
|