A small bash script I created for my own forum that gives a one-shot health overview of Discourse server. Sharing for anyone who finds this type of quick overview useful.
Checks system resources: Docker, Discourse services (Postgres, Redis, Nginx, Unicorn, Sidekiq), backup freshness, TLS, and security basics. Ends with a pass / warning / critical summary and an exit code suitable for cron.
Install
curl -O https://raw.githubusercontent.com/haydenjames/discourse-health-check/main/discourse-health-check.sh
chmod +x discourse-health-check.sh
sudo ./discourse-health-check.sh
Source, options, and a cron example in the README:
New version v1.0.4:
Two fixes:
-
Discourse replaced Unicorn with Pitchfork (default in 2026.2, Unicorn removed entirely
in 2026.4), so the web server check now detects both. Thanks @RGJ for flagging this
back in June. -
The service probes were matching their own command line.
pgrep -f <name>so pgrep matched itself and the check passed whether or not the service was actually up. Sidekiq had been reporting “running” unconditionally since 1.0.0. It could have been dead and you’d still get a green check and exit code 0 from cron. Same root cause as the Puma false positive in 1.0.1, which turned out to have been renamed rather than fixed.
