bmc-toolbox / bmclib

Library to abstract Baseboard Management Controller interaction
Apache License 2.0
194 stars 37 forks source link

Retrieve SEL in both opinionated and raw formats #375

Closed mattcburns closed 12 months ago

mattcburns commented 12 months ago

What does this PR implement/change/remove?

This PR adds the ability to retrieve the System Event Log from the target BMC using either IPMI or Redfish. There is an opinionated method that returns the entries as an array of entries in array format and a raw method that returns the raw output from the BMC.

Checklist

The HW vendor this change applies to (if applicable)

N/A

The HW model number, product name this change applies to (if applicable)

N/A

The BMC firmware and/or BIOS versions that this change applies to (if applicable)

N/A

What version of tooling - vendor specific or opensource does this change depend on (if applicable)

N/A

Description for changelog/release notes

Added GetSystemEventLog and GetSystemEventLogRaw. These methods retrieve the SEL of the target BMC. The former uses an opinionated format, retrieving the ID, Timestamp, Description, Message in an array format. The latter returns the raw output as a string. Both IPMI and Redfish are supported.
codecov[bot] commented 12 months ago

Codecov Report

Attention: 73 lines in your changes are missing coverage. Please review.

Comparison is base (0df7b75) 43.87% compared to head (6659f34) 43.93%.

Files Patch % Lines
internal/redfishwrapper/sel.go 0.00% 43 Missing :warning:
bmc/sel.go 76.62% 15 Missing and 3 partials :warning:
client.go 0.00% 8 Missing :warning:
providers/ipmitool/ipmitool.go 0.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #375 +/- ## ========================================== + Coverage 43.87% 43.93% +0.06% ========================================== Files 59 59 Lines 5042 5178 +136 ========================================== + Hits 2212 2275 +63 - Misses 2608 2678 +70 - Partials 222 225 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.