You are here

function hook_health_monitor_MONITOR in Health Status 7

This hook is called when the health system runs the monitors.

If you had a monitor called "value_in_table", your hook would be: hook_health_monitor_value_in_table($args).

Parameters

array $args: Args that have been passed from hook_health_monitor().

Return value

array This hook needs to return an array containing a status, and an (optional) message. The status can be HEALTH_OKAY, HEALTH_ERROR, HEALTH_WARNING or HEALTH_UNKNOWN. The message is just a string that will show up on the dashboard.

File

./health.api.php, line 79
This file contains examples and documentation of the various hooks you can use to add Health monitors to the Health Dashboard.

Code

function hook_health_monitor_MONITOR($args) {
  if (check_something()) {
    return health_monitor_status(HEALTH_OKAY, t("This is what we want, don't worry."));
  }
  else {
    return health_monitor_status(HEALTH_ERROR, t('Something is not true!'));
  }
}