function hook_health_monitors in Health Status 7
Allows you to add custom monitors to the Health Dashboard.
Format is: $monitors[NAME] = array( 'name' => 'Name of monitor', 'description' => 'Description of monitor.', 'group' => 'Monitors are shown in groups on the dashboard.', 'args' => array(), // Array of args that is sent to monitor hooks. );
Return value
array An array of monitors.
1 invocation of hook_health_monitors()
- health_get_monitors in ./
health.module - Gets monitors that have been registered.
File
- ./
health.api.php, line 47 - 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_monitors() {
// Make sure user mail addresses are valid.
$monitors['check_user_email'] = array(
'name' => t('Check user e-mail'),
'description' => t('Ensures user e-mail addresses are valid.'),
'group' => t('Users'),
);
// Checks to see if a value exists in some table.
$monitors['value_in_table'] = array(
'name' => t('Value in table check'),
'description' => t('Makes sure the value is in the table.'),
'group' => t('Misc'),
'args' => array(
'value' => 'something',
),
);
return $monitors;
}