server-agent
CMDOP Skill — install and use via CMDOP agent:
cmdop-skill install server-agent
Universal production server monitoring, self-healing, and reporting skill for cmdop.
Watches over Docker containers, detects anomalies, heals what is safe to heal, scans for vulnerabilities, and writes structured Markdown reports — all driven by the cmdop agent.
Quick Start
# Install
pip install -e .
cmdop skills install .
# Quick status check
server-agent status
# Full health check (auto-heals safe issues)
server-agent check
# Security scan
server-agent scan
# Heal a specific container
server-agent heal --container reforms-django
# Daily report
server-agent report --type daily
Commands
| Command | Description |
|---|---|
check |
Full health check: containers, disk, Redis. Auto-heals safe issues. |
scan |
Security scan: trivy CVEs, open ports, auth logs. |
heal |
Targeted remediation for a specific container. |
report |
Write structured MD reports (daily, security). |
status |
Quick server snapshot — no files written. |
All commands support --json for structured output and --dry-run to preview actions without executing them.
Environment Variables
| Variable | Required | Description |
|---|---|---|
REPORTS_DIR |
yes | Absolute path to reports directory |
TELEGRAM_BOT_TOKEN |
no | Bot token for Telegram notifications |
TELEGRAM_CHAT_ID |
no | Target chat/channel ID |
Autonomy Model
- SAFE (executes immediately):
docker restart,docker system prune - ESCALATE (sends Telegram alert): image rebuild, config changes, containers with >2 restarts, OOM
- NEVER: database commands,
rm -rfoutside/tmp, firewall changes
Protected containers (never auto-restarted): shared-db-redis, traefik
Setup on Production Server
# 1. Install
pip install server-agent
cmdop skills install server-agent
# 2. Set environment
export REPORTS_DIR=/root/server-agent/reports
export TELEGRAM_BOT_TOKEN=<token>
export TELEGRAM_CHAT_ID=<chat_id>
# 3. Verify
server-agent status --json
# 4. Generate port baseline
server-agent scan --baseline
# Review baseline/ports.json, then set reviewed: true
# 5. Start cmdop agent
cmdop agent start
# 6. Register triggers
cmdop trigger add --name "server-agent-check" --interval 300 \
--prompt "Run command: server-agent check"
cmdop trigger add --name "server-agent-scan" --interval 1800 \
--prompt "Run command: server-agent scan"
cmdop trigger add --name "server-agent-daily" --interval 86400 \
--prompt "Run command: server-agent report --type daily"
Two Modes of Operation
Scheduled monitoring (Python CLI)
Triggers call server-agent binary directly. No LLM in the check loop — fast, deterministic, cheap.
# Runs every 5 min via trigger
server-agent check
Interactive investigation (cmdop skill)
Use when you need the agent to reason about an incident:
cmdop run server-agent "reforms-django keeps restarting, investigate and fix"
The agent reads skill/readme.md as its system prompt and uses server-agent CLI as a tool to gather data and take action.
Reports Structure
$REPORTS_DIR/
index.md
baseline/ports.json
2026-03-14/
10-23-incident-reforms-django.md
14-05-security-scan.md
daily-summary.md
Metadata
Release files for server-agent 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| server_agent-0.1.1.tar.gz | 15.6 kB | Without provenance | Details for server_agent-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| server_agent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for server_agent-0.1.1-py3-none-any.whl |
Total release size: 34.8 kB
Release files / server_agent-0.1.1.tar.gz
| Download URL | server_agent-0.1.1.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fc3077d0b597329eb8e4d2724c0472b8eea9a3ee74bc259507ef90f70d38963
|
|
BLAKE2b-256 checksum How to use checksums |
0b36b45ec92f791d46590b6b35fadf9d0664a95c5ac1023ac49e1f0bcb03d2ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.2
|
Release files / server_agent-0.1.1-py3-none-any.whl
| Download URL | server_agent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68aeed26cc8c1435b152b40dcd0a566c99f0cbbf628abd16c3b878ed620a508d
|
|
BLAKE2b-256 checksum How to use checksums |
b1b52e013bfb4e9b2e69120c6eecc7b024437d7e64cf12c51a2426ae6bdada99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.2
|
Security for server-agent 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.