On 04/26/2014 05:30 AM, sarath azad wrote:
>
> Could you please help regarding sensor's event handling using OpenIPMI
> library?
>  
> I am writing an application to monitor the sensors on my machine
> (server) using OpenIPMI library. I have ran the sample programs
> provided with OpenIPMI library and below are my understanding from
> that, please correct me if I am wrong:
>
> 1.       while opening the domain (ipmi_open_domain) we will provide
> all the call back functions to be called when a sensor is added or
> removed and also the event handlers which will be called when an event
> is detected on the sensor.

Yes, that is correct.

> 2.       Now I am getting the sensors added only if I am  running
> os_hnd->operation_loop(os_hnd); or os_hnd->perform_one_op(os_hnd,
> NULL) functions.

Yes, the operation loop is what actually runs things in the library. 
Sort of like X windows, if you are familiar with that.



> Could you please tell :
>
> 1.       For receiving the events on the sensors whether its threshold
> is crossed etc and getting the corresponding event handlers callback
> functions to be called, do we need to keep continuously run the
> functions operation_loop / perform_one_op?

Yes, you should continuously call the operation loop.  You have two
basic options here:

 1. Run the event loop in a separate thread.  OpenIPMI is thread-safe,
    but you will have to deal with multithreading in your code.
 2. Run all of your operations from the event loop.  I'm not sure how
    your code is designed, but this is generally the easiest option.

Basically, if your code is already multi-threaded, then option 1 is
probably the easiest.  If your code is not multi-threaded, then you
probably have some event loop someplace where you call select() or
poll() and distribute out the events from there.  Then option 2 is
probably the best.  You can use OpenIPMI's event loop, or you can
provide your own OS handler and use your own event loop.

>
> 2.       What is the role of the scan interval provided by
> ipmi_domain_set_sel_rescan_time() and
> ipmi_domain_set_ipmb_rescan_time()? Does it impact operation_loop /
> perform_one_op?

Those set the time between rescans of the event log and the IPMB bus. 
The IPMB bus scan is probably not that critical, but some hardware can
hot add/remove management controllers.  The event log is a bigger deal,
that sets the maximum amount of time between when an event occurs and
when the event is detected by the library.

> Inside the operation_loop / perform_one_op functions we are doing
> select system call and waiting for some events to occur. How this is
> effected by ipmi_domain_set_sel_rescan_time() and
> ipmi_domain_set_ipmb_rescan_time()?
>  
It will mess up timing.  Why don't you use the os handler select call? 
That way you don't have to do the select call, the OS handler will do it
for you and distribut out the events?

-corey


> Thanks and regards
> S Sarath 
>
>
>
>
> ------------------------------------------------------------------------------
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
>
>
> _______________________________________________
> Openipmi-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openipmi-developer


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to