Adam Grossman wrote:
> i think i am missing an important concept. (this all related to my
> sensor question...) i know that openIPMI is event driven, but i tried
> connection the IMPI, and then iterating through all the entities, using
> "ipmi_domain_iterate_mcs", and no entities showed up. But when i use
> "ipmi_domain_add_entity_update_handler", they do all show up. and then
> i need to do the "..._add_sensor_.." event handler to get all the
> sensors. i guess i am confused, because is a mere existence or
> discovery an event, not just a change in state?
>
Discovery is an event. When OpenIPMI first starts up, it doesn't know
about anything and starts the scanning process. As it finds things it
will tell you. If you iterate right at startup, it won't have found
anything yet. You register a "new entity" handler for the domain, and
then a "new sensor" handler with each new event to tell you when new
sensors are added. You can look for the sensors you want in the "new
sensor" handler. As you find them, you can store the sensor ids in a
list or something.
Then, later on, when you need the values, you can call
ipmi_sensor_id_get_states() or ipmi_sensor_id_get_readings() with the
sensor id when you you want to fetch the value.
I assume by "sensor_id" you mean OpenIPMI's concept of a sensor id. If
you mean the sensor's LUN and sensor number from the BMC's point of
view, you can fetch those from a sensor using ipmi_sensor_get_num().
OpenIPMI was really designed for a program that comes up and
continuously monitors things. Startup is somewhat expensive because of
all the scanning, but once it's up it's fairly efficient. If that's
what you are doing, then OpenIPMI is the program for you. If you are
just calling something from a script periodically to get values,
ipmitool might be a better fit (though it's still somewhat slow because
it has to scan, too).
-corey
> thank you,
> -=- adam grossman
>
> [EMAIL PROTECTED] wrote:
>
>> I also meant to show another thing with the code, here it is again with
>> an addition:
>>
>>
>> void domainEventHandler(ipmi_domain_t *domain,
>> ipmi_event_t *event,
>> void *callbackData) {
>>
>> int sensorNumber;
>> ipmi_sensor_id_t sensorID;
>>
>> sensorID = ipmi_event_get_generating_sensor_id(domain, NULL, event);
>> // now you can use sensorID with ipmi_sensor_id_reading_get()
>>
>> // You can also use sensorID to get the sensor number:
>> sensorNumber = sensorID.sensor_num;
>> }
>>
>> --Jen
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Openipmi-developer mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/openipmi-developer
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Openipmi-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openipmi-developer
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer