Currently when we issue ipmitool command to get SEL Record ID, it prints the following outdated event log entry if SEL Record ID is not present.
ipmitool -I lanplus -H <ip address> -P PASSW0RD -C 1 sel get 1 Get SEL Entry 1 command failed: Requested sensor, data, or record not found SEL Record ID : 0000 Record Type : 00 Timestamp : 01/01/1970 00:00:00 Generator ID : 92c0 EvM Revision : 04 Sensor Type : Power Supply Sensor Number : 28 Event Type : Reserved Event Direction : Assertion Event Event Data : 0d0809 This patch is to avoid printing outdated event log entry if SEL Record ID is not present. Test results: ./ipmitool -I lanplus -H <IP address> -P PASSW0RD -C 1 sel get 80 5 1 Get SEL Entry 50 command failed: Requested sensor, data, or record not found SEL Record ID : 0005 Record Type : 02 Timestamp : 03/03/2014 17:38:47 Generator ID : 2000 EvM Revision : 04 Sensor Type : System Event Sensor Number : 36 Event Type : Generic Discrete Event Direction : Assertion Event Event Data : 411fff Description : Transition to Non-critical from OK SEL Record ID : 0001 Record Type : 02 Timestamp : 03/03/2014 17:38:46 Generator ID : 2000 EvM Revision : 04 Sensor Type : System Event Sensor Number : 36 Event Type : Generic Discrete Event Direction : Assertion Event Event Data : 466fff Description : Transition to Non-recoverable Signed-off-by: Mamatha Inamdar <mamat...@linux.vnet.ibm.com> --- 0 files changed diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c index 63ecbcf..e24f9e5 100644 --- a/lib/ipmi_sel.c +++ b/lib/ipmi_sel.c @@ -2898,7 +2898,12 @@ ipmi_sel_show_entry(struct ipmi_intf * intf, int argc, char ** argv) lprintf(LOG_DEBUG, "Looking up SEL entry 0x%x", id); /* lookup SEL entry based on ID */ - ipmi_sel_get_std_entry(intf, id, &evt); + if(!ipmi_sel_get_std_entry(intf, id, &evt)) { + lprintf(LOG_DEBUG, "SEL Entry %d not found", id); + rc = -1; + continue; + } + if (evt.sel_type.standard_type.sensor_num == 0 && evt.sel_type.standard_type.sensor_type == 0 && evt.record_type == 0) { lprintf(LOG_WARN, "SEL Entry 0x%x not found", id); rc = -1; ------------------------------------------------------------------------------ Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk _______________________________________________ Ipmitool-devel mailing list Ipmitool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipmitool-devel