openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

openhpi fires off unneeded events after start #2512

Closed openhpi2 closed 8 years ago

openhpi2 commented 11 years ago

When openhpi is restarted for whatever reason, at the end of the discovery process we fire off events for each discovered resource (this happens since day one with any openhpi version)

So we fire off a bunch of stuff like the following: Event Type: HOTSWAP From Resource: {SYSTEM_CHASSIS,1}{SYSTEM_BLADE,13} Event Resource ID: 18 Event Timestamp: 2013-08-08 09:45:24 Event Severity: OK HotswapEvent: HotSwapState: ACTIVE PreviousHotSwapState: INACTIVE

This happens in the SaErrorT discover_oa_soap_system(struct oh_handler_state *oh_handler) function At the end of such function a call to oa_soap_push_disc() is done: 444 dbg(" Discovering LCD ............................."); 445 rv = oa_soap_disc_lcd(oh_handler); 446 if (rv != SA_OK) { 447 err("Failed to discover LCD"); 448 return rv; 449 } 450 451 oa_soap_push_disc_res(oh_handler);

oa_soap_push_disc_rest() loops over the resource table and generates the event (HOTSWAP, SENSOR, RESOURCE, etc.) based on resource type and capabilities. Now the this oa_soap_push_disc_rest() function is only called after the discovery is over and once only. So we're really only talking about the slew of events queued up at the end of every discovery process. The main issue being that HOTSWAP events and SENSOR events seem to be out of place in this context as no HOTSWAP really took place.

I attach a patch here that removes the firing off of HOTSWAP and RESOURCE events and keeps the SENSOR events.

I've tested it and the results are:

Reported by: mbaldessari

openhpi2 commented 11 years ago

*_ATTENTION_** This account is disabled and is no longer accessed by the recipient. Please remove it from your address book.

Thanks

Original comment by: tariqx

openhpi2 commented 9 years ago

If we make the changes as suggested the events are not seen, but the RPT's are also not getting added. Looks like removing the events does not work. Looks like we could leave these as it is or have all the events as resource events. We are looking into this.

Original comment by: dr_mohan

openhpi2 commented 9 years ago

The Field Replaceable Units (FRUs) can not have RESOURCE events with ResourceEventType of ADDED. Those events are dropped by infrastructure and the RPT's are not added. So we are leaving the code as it is. The initial HOTSWAP events will be added as informational events. It also signifies the FRU's getting added to the RPT.

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Original comment by: dr_mohan

openhpi2 commented 9 years ago

RPT's are not getting added. The informational events will be added at the start. The events during OA switchover were already addressed

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Does this mean we will continue to see the false HOTSWAP events being raised as CRITICAL for a regular restart of service even when no such event has occurred?

Original comment by: rdossant

openhpi2 commented 9 years ago

When the daemon starts for the first time, Managed hotswap resources get a hotswap event with OK severity when the resources are added to the RPT. Client restarts do not create an event.

Original comment by: dr_mohan