Health check
mc-dm:health-check runs eight named probes against the addon's runtime and reports pass / warn / fail per probe. Probe names are stable, output is line-oriented, and the command exits non-zero when any probe fails — feed it straight to a monitoring script.
php cmd.php mc-dm:health-check
Sample output:
PASS addon_active active
PASS storage_mount_writable round-trip OK
PASS db_schema_sync 27 xf_mc_dm_* tables present
PASS db_columns_sync 7 entity selects ok
PASS job_queue_depth 0 addon jobs queued
PASS cron_schedule 7 active crons scheduled
PASS registry_loadable 4/4 registries loaded
PASS option_sanity 2 required options present
Probes
| Name | What it checks | warn condition | fail condition |
|---|---|---|---|
addon_active | The addon is installed and not disabled | — | xf_addon row missing or active = 0 |
storage_mount_writable | A file written through internal-data://mc-downloads/ can be read back and deleted | — | Write threw, or the round-trip read returned nothing |
db_schema_sync | All addon tables exist | — | Fewer than 14 xf_mc_dm_* tables present |
db_columns_sync | Each entity selects without a column-not-found error | — | At least one entity throws on SELECT |
job_queue_depth | Backlog of addon-owned jobs in xf_job | More than 0 jobs queued | — |
cron_schedule | Addon cron entries are active and not stuck | A cron's next_run is more than 7 days in the past | — |
registry_loadable | All four extension registries (Gate, Processor, Source, Stats) instantiate cleanly | — | Any registry throws during construction |
option_sanity | Required options resolve to a value | — | Any required option is missing or empty |
Exit codes
0— every probe passed (or warned).1— at least one probe reportedfail.
warn does not affect the exit code. A backlog of jobs or a slightly stale cron is not necessarily an outage; it is information for the operator.
Wiring into monitoring
Cron the command at whatever interval matches your alerting tolerance and pipe the output to your log shipper:
*/5 * * * * cd /var/www/forum && php cmd.php mc-dm:health-check >> /var/log/mc-dm-health.log 2>&1
For pull-based monitoring (Nagios, Sensu, Zabbix), shell out to the command and treat the exit code as the check state. The line-oriented output is parseable with awk '$1 == "FAIL"' if you want per-probe alerting downstream.