System Administration Intermediate

Gateway Watchdog Auto-Restart

Creates a self-monitoring watchdog that checks if the OpenClaw gateway is responding, auto-restarts it if down, and sends notifications. Runs in background.

Prompt
Create a background watchdog service that monitors the OpenClaw gateway health. The watchdog should:
1. Check gateway status every 30 seconds via openclaw gateway status
2. If gateway is down, automatically restart it using openclaw gateway restart
3. Send me a notification via message tool when restarts occur
4. Log all restart events to a file in the workspace
5. Run continuously in the background without blocking other operations

Make it resilient and ensure it starts automatically when the system boots.
Expected Outcome

Background watchdog service that monitors gateway health, automatically restarts on failure, and notifies you when restarts occur.

Details

Prompt Text Create a background watchdog service that monitors the OpenClaw gateway health. The watchdog should: 1. Check gateway status every 30 seconds via openclaw gateway status 2. If gateway is down, automatically restart it using openclaw gateway restart 3. Send me a notification via message tool when restarts occur 4. Log all restart events to a file in the workspace 5. Run continuously in the background without blocking other operations Make it resilient and ensure it starts automatically when the system boots.
Category System Administration
Difficulty Intermediate
Author Ben Jammin (@xBenJamminx)
Expected Outcome Background watchdog service that monitors gateway health, automatically restarts on failure, and notifies you when restarts occur.
#community #tested

Related Resources