X hits on this document

PDF document

February 10, 2006 - page 188 / 238

612 views

0 shares

0 downloads

0 comments

188 / 238

void

*cb_data,

_ _ ipmi event t

*event)

id = ipmi_entity_get_entity_id(ent); instance = ipmi_entity_get_entity_instance(ent); ipmi_sensor_get_id(sensor, name, 32);

176

APPENDIX H. SAMPLE PROGRAM SHOWING BASIC OPERATIONS

{

ipmi_entity_t *ent int id, instance; char name[33];

= i p m i _ s e n s o r _ g e t _ e n t i t y ( s e n s o r ) ;

printf("Event from sensor %d.%d.%s: %d %s\n",

id, instance, name,

i offset, p m i _ g e t _ e v e n t _ d i r

_

string(dir));

if

(severity printf("

!= -1) severity

is

%d\n", severity);

if

( p r e v _ s e v e r i t y

!=

  • -

    1)

printf(" if (event)

p r e v s e v e r i t y i s % d \ n " , p r e v _ s e v e r i t y ) ;

printf("Due to event 0x%4.4x\n", ipmi_event_get_record_id(event));

/* This passes the event on to the main event handler, which does not exist in this program. */ return IPMI_EVENT_NOT_HANDLED;

}

_ _ sensor change(enum ipmi_update e op,

_ ipmi entity_t

*ent,

_ ipmi sensor_t

*sensor,

void

*cb_data)

/* Whenever the status of a sensor changes, the function is called

We display the information of the sensor if we find a new sensor */ static void

{

int id, instance; char name[33]; int rv;

id = ipmi_entity_get_entity_id(ent); instance = ipmi_entity_get_entity_instance(ent); ipmi_sensor_get_id(sensor, name, 32); if (op == IPMI_ADDED) {

printf("Sensor added: %d.%d.%s\n", id, instance, name);

Document info
Document views612
Page views612
Page last viewedWed Dec 07 13:20:03 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments