X hits on this document

PDF document

February 10, 2006 - page 204 / 238

1181 views

0 shares

0 downloads

0 comments

204 / 238

_ _ got_events(ipmi sensor t

*sensor,

int

err,

_ _ _ ipmi event state t *states,

void

_ *cb data)

printf("Events set for sensor %s\n", sdata->name);

static void

{

/* Turn on the general events for a sensor, since this at

least supports per-sensor enables. */ ipmi_event_state_set_events_enabled(sdata->es, 1); ipmi_event_state_set_scanning_enabled(sdata->es, 1);

192

APPENDIX I. SAMPLE PROGRAM SHOWING EVENT SETUP

}

if (err) { printf("Error 0x%x getting events for sensor %s\n", err, sdata->name); goto out_err;

}

{

s d a t a _ t * s d a t a = c b _ d a t a ;

if (err) { printf("Error 0x%x setting events for sensor %s\n", err, sdata->name); goto out;

}

r out: e l e a s e _ s d a t a ( s d a t a ) ;

s d a t a _ t * s d a t a = c b _ d a t a ;

int

rv;

printf("Sensor %s event settings:\n", sdata->name); if (sdata->state_sup != IPMI_EVENT_SUPPORT_PER_STATE) { /* No per-state sensors, just do the global enable. */ } else if (ipmi_sensor_get_event_reading_type(sensor) == IPMI_EVENT_READING_TYPE_THRESHOLD) { /* Check each event, print out the current state, and turn it on in the events to set if it is available. */ enum ipmi_event_value_dir_e value_dir;

_ _ enum ipmi event_dir e

dir;

_ enum ipmi thresh_e

thresh;

int

val;

f o r ( v a l u e _ d i r = I P M I _ G O I N G _ L O W ; v a l u e _ d i r < = I P M I _ G O I N G _ H I G H ; v a l u e _ d i r + + )

Document info
Document views1181
Page views1181
Page last viewedTue Jan 24 20:16:04 UTC 2017
Pages238
Paragraphs8090
Words85809

Comments