sp healthcheck

Monitor service health and receive alerts when something goes down.

Usage

bash
sp healthcheck

What it does

sp healthcheck inspects the running state of each active service container and compares it to the last known state. When a service transitions from running to stopped (or recovers back to running), it reports the event to the ServicePlus License API.

The License API then forwards the alert to the ServicePlus support channel, so the provider is notified of any issues on your deployment. This is a passive monitoring channel — you do not configure alert destinations yourself.

Automating healthchecks

Run healthcheck on a cron schedule so state changes are detected promptly:

bash
# Edit your crontab
crontab -e

# Add this line to check every 5 minutes
*/5 * * * * /usr/local/bin/sp healthcheck >> /var/log/sp-health.log 2>&1
Alerts are only sent on state transitions (running → stopped or stopped → running), not on every check. Running this every 5 minutes will not flood any notification channel during normal operation.

What gets checked

  • Container running state for each enabled service
  • State transitions are compared against the previous check stored in ~/.sp/mautic/status/health_state.json

Alert payload

When a state change is detected, the CLI sends to the License API: the serial number, project name, domain, service name, status (down or recovered), and timestamp. This data is used by ServicePlus support to be aware of your deployment health.