X hits on this document

PDF document

February 10, 2006 - page 210 / 238

633 views

0 shares

0 downloads

0 comments

210 / 238

198

APPENDIX I. SAMPLE PROGRAM SHOWING EVENT SETUP

use_sdata(sdata); rv = ipmi_sensor_get_thresholds(sensor, got_thresholds, sdata); if (rv) { printf("ipmi_thresholds_get returned error 0x%x" " for sensor %s\n", rv, sdata->name); release_sdata(sdata); } } else if (op == IPMI_DELETED) { sdata = find_sdata(sensor); if (!sdata) { char name[120]; ipmi_sensor_get_name(sensor, name, sizeof(name));

printf("sensor %s was deleted but not found in the sensor db\n", name); goto out;

}

printf("sensor %s was deleted\n", sdata->name); release_sdata(sdata);

}

out: return;

}

_ entity_change(enum ipmi_update e op,

_ ipmi domain_t

*domain,

_ ipmi entity_t

*entity,

void

*cb_data)

/* Whenever the status of an entity changes, the function is called

When a new entity is created, we search all sensors that belong to the entity */ static void

{

int rv; char name[50];

ipmi_entity_get_name(entity, name, sizeof(name)); if (op == IPMI_ADDED) { printf("Entity added: %s\n", name); /* Register callback so that when the status of a sensor changes, sensor_change is called */ r v = i p m i _ e n t i t y _ a d d _ s e n s o r _ u p d a t e _ h a n d l e r ( e n t i t y ,

Document info
Document views633
Page views633
Page last viewedThu Dec 08 10:08:15 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments