예제 #1
0
static void
dm_fault_execute_actions(fmd_hdl_t *hdl, diskmon_t *diskp, nvlist_t *nvl)
{
	const char		*action_prop = NULL;
	const char		*action_string;

	/*
	 * The predictive failure action is the activation of the fault
	 * indicator.
	 */
	if (fmd_nvl_class_match(hdl, nvl,
	    DISK_ERROR_CLASS "." FM_FAULT_DISK_OVERTEMP))
		action_prop = DISK_PROP_OTEMPACTION;

	if (fmd_nvl_class_match(hdl, nvl,
	    DISK_ERROR_CLASS "." FM_FAULT_DISK_TESTFAIL))
		action_prop = DISK_PROP_STFAILACTION;

	dm_fault_indicator_set(diskp, INDICATOR_ON);

	if (action_prop != NULL &&
	    (action_string = dm_prop_lookup(diskp->props, action_prop))
	    != NULL) {

		if (dm_platform_indicator_execute(action_string) != 0) {
			log_warn("Fault action `%s' did not successfully "
			    "complete.\n", action_string);
		}
	}
}
예제 #2
0
const char *
dm_plugin_prop_lookup(const char *propname)
{
	return (dm_prop_lookup(dm_global_proplist(), propname));
}