Kerosene checks Plex every minute. If Plex crashes or remains unresponsive for three consecutive checks, the watchdog restarts the native QNAP Plex service and checks whether it comes back online.
Installed and verified on September 12, 2026. This runs directly on the NAS and continues without an open chat or SSH connection.
| Setting | Behavior |
|---|---|
| Host | Kerosene — 192.168.10.173 |
| Plex installation | Native QNAP package, PlexMediaServer |
| Check interval | Every minute |
| Health check | http://127.0.0.1:32400/identity must return HTTP 200 and a Plex XML identity |
| Failure threshold | Three consecutive failed checks; normally about two to three minutes |
| Recovery action | /etc/init.d/plex.sh restart |
| Recovery verification | Up to twelve health probes, five seconds apart; each HTTP probe has a five-second socket timeout |
| Restart cooldown | At least fifteen minutes between attempts |
| Restart limit | Two attempts in a rolling hour; the budget survives healthy checks and reboots |
| Boot grace period | Ten minutes after NAS startup |
| Maintenance controls | App Center disabling Plex or the watchdog's PAUSE file inhibits recovery |
The check uses loopback, so an Internet, DNS, or reverse-proxy outage does not trigger a Plex restart. A final health check immediately before restarting allows for Plex recovering on its own. A file lock prevents overlapping watchdog runs.
If Plex still does not respond after a restart, the result is logged. Monitoring continues, and further recovery attempts wait for the cooldown and hourly limit. Restarting can restore service, but does not repair the underlying cause of a crash or confirm playback and transcoding work.
Run these commands over SSH on Kerosene as admin.
Read the current monitoring state:
cat /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/state.json
Useful fields:
status: healthy, recovering, paused, or the reason recovery is waiting.last_checked and last_healthy: Unix timestamps for the latest check and successful response.failures: consecutive failed checks.attempts: restart timestamps still within the rolling hourly budget.Check Plex immediately without changing watchdog state or restarting it:
/usr/local/bin/python /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/plex_watchdog.py --check
A normal response includes "healthy": true and an empty "inhibited" value. An inhibition reason means automatic recovery is paused even if Plex currently responds.
Read recent recovery events:
tail -50 /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/watchdog.log
The log records state changes rather than every successful check. It retains one rotated copy, approximately 512 KiB per file. Email and push notifications are not configured for this watchdog.
Disabling Plex in QNAP App Center is respected automatically. Before stopping Plex directly from the command line, updating it manually, or troubleshooting a crash, pause recovery:
touch /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/PAUSE
The next scheduled check will record paused for maintenance. This pauses recovery; it does not stop Plex.
Resume monitoring after maintenance:
rm /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/PAUSE
Plex must also be enabled in App Center. The normal failure threshold and restart limits still apply after resuming.
state.json and watchdog.log for recovery attempts and whether Plex responded afterward.The watchdog also skips recovery while the Plex installation or data directory is unavailable. An invalid state file causes it to log an error and refuse automatic restarts, preserving the restart limit.
Runtime directory on Kerosene:
/share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog
The directory and script are owned by the NAS administrator and restricted to administrator access. The script uses QNAP's existing /usr/local/bin/python with standard-library modules; it requires no additional container or package.
The following entry is installed in both the persistent /etc/config/crontab and the active crontab:
* * * * * /usr/local/bin/python /share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/plex_watchdog.py >/dev/null 2>&1 # fueltech-plex-watchdog
This uses QNAP's persistent scheduling procedure, so the schedule is configured to survive NAS reboots. Existing scheduled jobs were preserved.
Source and test copies on Octane are in /home/bmgaspard/plex-watchdog-kerosene. The pre-installation scheduler backup is on Kerosene at:
/share/CACHEDEV3_DATA/.fueltech-automation/plex-watchdog/crontab-before-20260912
PAUSE file and allow any current recovery action to finish.# fueltech-plex-watchdog from /etc/config/crontab.crontab /etc/config/crontab && /etc/init.d/crond.sh restart
Leave unrelated jobs intact. Restoring the entire old scheduler backup later could remove jobs added since installation. The script and logs can remain for reference after its cron entry is removed.
Nine simulated tests passed locally and under Kerosene's native Python runtime. They covered confirmed crashes, recovery, temporary failures, maintenance inhibition, cooldowns, rolling restart limits, persistent budgets, and missed checks or clock changes.
The first scheduled check at 03:48 UTC on September 12, 2026 reported Plex healthy with zero restart attempts. Plex was not deliberately stopped or crashed during installation testing.