{"skill":{"slug":"service-watchdog","displayName":"Service Watchdog","summary":"Monitors self-hosted services by checking HTTP endpoints, TCP ports, SSL expiry, and DNS resolution, then reports status and alerts in concise, chat-friendly...","description":"# Service Watchdog\n\nLightweight service and endpoint monitoring for self-hosted infrastructure. Checks HTTP endpoints, TCP ports, SSL certificate expiry, and DNS resolution — then reports status in a clean, chat-friendly format.\n\n## What It Does\n\n- **HTTP Health Checks** — GET/POST with expected status codes, response time tracking, content matching\n- **TCP Port Checks** — Verify services are listening (databases, mail servers, game servers, etc.)\n- **SSL Certificate Monitoring** — Days until expiry, issuer info, auto-warn thresholds\n- **DNS Resolution** — Verify domains resolve correctly, detect DNS hijacking\n- **Smart Summaries** — One-glance status for all your services, with trend data\n- **Alert Logic** — Configurable thresholds, cooldowns, and severity levels to prevent alert fatigue\n\n## Quick Start\n\n### 1. Create a watchlist\n\nCreate `watchdog.json` in your workspace root:\n\n```json\n{\n  \"services\": [\n    {\n      \"name\": \"Home Assistant\",\n      \"type\": \"http\",\n      \"url\": \"http://192.168.1.100:8123\",\n      \"expect_status\": 200,\n      \"timeout_ms\": 5000\n    },\n    {\n      \"name\": \"Proxmox\",\n      \"type\": \"https\",\n      \"url\": \"https://proxmox.local:8006\",\n      \"expect_status\": 200,\n      \"ssl_warn_days\": 14,\n      \"timeout_ms\": 5000\n    },\n    {\n      \"name\": \"PostgreSQL\",\n      \"type\": \"tcp\",\n      \"host\": \"db.local\",\n      \"port\": 5432,\n      \"timeout_ms\": 3000\n    },\n    {\n      \"name\": \"My Domain\",\n      \"type\": \"dns\",\n      \"domain\": \"example.com\",\n      \"expect_ip\": \"93.184.216.34\"\n    }\n  ],\n  \"defaults\": {\n    \"timeout_ms\": 5000,\n    \"ssl_warn_days\": 14,\n    \"alert_cooldown_min\": 30,\n    \"history_retention_days\": 30\n  }\n}\n```\n\n### 2. Run a check\n\n```bash\nbash skills/service-watchdog/watchdog.sh\n```\n\nOutput example:\n```\n🟢 Home Assistant       — 200 OK (142ms)\n🟢 Proxmox              — 200 OK (89ms) | SSL: 47 days\n🟢 PostgreSQL           — port 5432 open (12ms)\n🟢 My Domain            — resolves to 93.184.216.34 ✓\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n4/4 healthy | avg response: 81ms | checked: 2026-02-24 16:30 UTC\n```\n\n### 3. Detailed report\n\n```bash\nbash skills/service-watchdog/watchdog.sh --report\n```\n\nShows trend data: uptime percentage, P95 response times, incident history.\n\n### 4. JSON output (for cron integration)\n\n```bash\nbash skills/service-watchdog/watchdog.sh --json\n```\n\n### 5. Check SSL only\n\n```bash\nbash skills/service-watchdog/watchdog.sh --ssl-only\n```\n\n### 6. Alert summary (for messaging)\n\n```bash\nbash skills/service-watchdog/watchdog.sh --alerts-only\n```\n\nOnly outputs services that need attention (down, slow, SSL expiring).\n\n## Cron Integration\n\nAdd to your OpenClaw cron for continuous monitoring:\n\n**Every 5 minutes (lightweight check):**\n```\nRun `bash skills/service-watchdog/watchdog.sh --json` and report only if any service is unhealthy.\n```\n\n**Daily SSL report:**\n```\nRun `bash skills/service-watchdog/watchdog.sh --ssl-only` and report expiring certificates.\n```\n\n## Configuration Reference\n\n### Service types\n\n| Type | Required Fields | Optional Fields |\n|------|----------------|-----------------|\n| `http` / `https` | `url` | `expect_status`, `expect_body`, `method`, `headers`, `timeout_ms`, `ssl_warn_days` |\n| `tcp` | `host`, `port` | `timeout_ms` |\n| `dns` | `domain` | `expect_ip`, `nameserver` |\n\n### Global defaults\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `timeout_ms` | 5000 | Request timeout |\n| `ssl_warn_days` | 14 | SSL expiry warning threshold |\n| `alert_cooldown_min` | 30 | Min minutes between repeated alerts |\n| `history_retention_days` | 30 | How long to keep check history |\n| `history_file` | `watchdog-history.csv` | Path for check history data |\n\n## How the Agent Should Use This\n\nWhen the user asks about service status, infrastructure health, or \"are my services up?\":\n\n1. Run `bash skills/service-watchdog/watchdog.sh` for a quick overview\n2. Run with `--report` for detailed trends and history\n3. Run with `--alerts-only` for just the problems\n4. Run with `--ssl-only` to check certificate status\n5. Run with `--json` when you need structured data for further analysis\n\nFor proactive monitoring, run checks in cron jobs and only alert the user when something is wrong.\n\n## Requirements\n\n- `curl` (for HTTP/HTTPS checks)\n- `openssl` (for SSL certificate checks)\n- `nc` or `ncat` (for TCP port checks) — falls back to bash `/dev/tcp` if unavailable\n- `dig` or `nslookup` (for DNS checks) — falls back to `host` command\n- `jq` (for JSON config parsing)\n\nAll standard on most Linux distributions. No external APIs or accounts needed.\n","tags":{"devops":"1.0.0","homelab":"1.0.0","infrastructure":"1.0.0","latest":"1.0.0","monitoring":"1.0.0"},"stats":{"comments":0,"downloads":1221,"installsAllTime":3,"installsCurrent":3,"stars":2,"versions":1},"createdAt":1771952023893,"updatedAt":1779077268829},"latestVersion":{"version":"1.0.0","createdAt":1771952023893,"changelog":"Initial release: HTTP/HTTPS, TCP, DNS, SSL monitoring with history tracking, JSON output, alerts-only mode, and cron integration","license":null},"metadata":null,"owner":{"handle":"mariusfit","userId":"s17en27tt4m76ranka73sgtdfd884sb7","displayName":"mariusfit","image":"https://avatars.githubusercontent.com/u/53900085?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779956602838}}