OpenClaw Monitor is a local watchdog and control room for the OpenClaw gateway.
If your gateway sometimes drops, half-restarts, or quietly stays offline after an update or recovery attempt, this tool is built for that exact problem. It checks health on a schedule, tries to bring the gateway back when it stays down, records what happened, and gives you a clean local dashboard to see uptime, failures, recoveries, and usage at a glance.
Use it when you want OpenClaw to feel less like a process you babysit and more like a service you can rely on.
OpenClaw is useful, but when the gateway gets into a bad state, reliability is what matters most.
This project helps with that by:
- checking gateway health on a schedule
- retrying recovery when the gateway stays down
- logging incidents and recovery work
- surfacing uptime and usage in a local dashboard
- making common actions available directly from the UI
- Automatic gateway health checks using
openclaw gateway status --json - Configurable recovery flow with
restart,start, andinstallfallback behavior - macOS
launchdintegration so it can run unattended on a Mac mini - Local notifications for prolonged downtime or failed recovery
- A dashboard with availability, recovery activity, recent events, and usage cost
- Quick actions for one-time check, start, stop, restart, open gateway, and config override
- Event history and snapshots stored locally in plain files
npm install
npm run buildnpm run checkThis performs a health check immediately and records the result under data/.
npm run dashboardThen open http://127.0.0.1:4317.
npm run service:install
npm run service:statusThat installs a launchd agent so checks continue running in the background.
Star this repo if it helps *-*
- Availability trend: 24 hours of 15-minute uptime buckets
- Recovery activity: steps and outcomes grouped by local day
- Recent events: paginated and filterable by level, type, and text
- Quick actions: run operational commands without leaving the page
- Config override: adjust check interval and thresholds from the UI
- Usage cost: daily cost view plus grouped totals by source
npm run build: compile the TypeScript project intodist/npm run check: run one immediate health check and recovery pass if needednpm run collect: refresh gateway probe, health, and usage-cost snapshotsnpm start: run the monitor entrypoint directlynpm run dashboard: build and start the local dashboard servernpm run report: print a quick health and recovery summary in the terminalnpm run service:install: install the macOSlaunchdbackground servicenpm run service:status: show whether thelaunchdservice is loadednpm run service:uninstall: remove thelaunchdbackground service
Configuration lives in openclawmonitor.config.json.
{
"checkIntervalMinutes": 5,
"failureThreshold": 3,
"recoveryCooldownMinutes": 15,
"statusTimeoutMs": 10000,
"dataDir": "./data",
"openclawBin": "/opt/homebrew/bin/openclaw",
"dashboardPort": 4317,
"usageImportDir": "./data/usage-imports",
"usageGatewayCategory": "gateway",
"notifications": {
"enabled": true,
"title": "OpenClaw Monitor",
"downtimeAlertMinutes": 15,
"repeatAlertMinutes": 30
},
"collectors": {
"probe": true,
"health": true,
"usageCost": true,
"usageCostDays": 30
},
"launchd": {
"label": "ai.openclaw.monitor",
"runAtLoad": true
},
"recoverySteps": ["restart", "install", "restart"]
}Most important settings:
checkIntervalMinutes: how often the monitor runsfailureThreshold: consecutive failed checks before recovery startsrecoveryCooldownMinutes: minimum delay between recovery attemptsstatusTimeoutMs: timeout for OpenClaw health commandsopenclawBin: absolute path to the OpenClaw CLI, recommended forlaunchd
Runtime data is intentionally simple and inspectable:
data/state.json: current monitor statedata/events.jsonl: event historydata/snapshots/: latest collectedprobe,health, andusage-costdata/launchd.out.log: background service outputdata/launchd.err.log: background service errors
The dashboard can merge additional usage sources beyond the built-in OpenClaw usage collector.
Drop JSON files into usageImportDir with this shape:
{
"sourceId": "openai-api",
"label": "OpenAI API",
"category": "openai_api",
"collectedAt": "2026-03-10T18:00:00.000Z",
"payload": {
"totals": {
"totalCost": 12.34,
"totalTokens": 123456
},
"daily": []
}
}That makes it possible to compare OpenClaw usage with other paths such as OpenAI API or OAuth-backed tooling.
- Better channel status cards for WhatsApp and other integrations
- Incident grouping so repeated failures become one outage view
- Richer usage breakdowns across multiple billing paths
- Optional webhooks, Slack, email, or Telegram alerts
- Retention policies for longer-running deployments
OpenClaw Monitor is useful if you:
- run OpenClaw on a dedicated Mac mini or home server
- want automatic recovery instead of manual babysitting
- need a local dashboard instead of digging through logs
- want to understand how often the gateway is failing and what recovery did
This project is already usable as a local reliability tool, and it is structured to grow into a fuller monitoring and usage console over time.
