-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get systemeventlog #376
Get systemeventlog #376
Conversation
Clipped one line too high when fixing the conflicts earlier
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 43.37% 43.47% +0.10%
==========================================
Files 59 59
Lines 5144 5274 +130
==========================================
+ Hits 2231 2293 +62
- Misses 2696 2762 +66
- Partials 217 219 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work here, left a few comments
examples/sel/main.go
Outdated
err = cl.ClearSystemEventLog(ctx) | ||
if err != nil { | ||
l.WithError(err).Fatal(err, "failed to clear System Event Log") | ||
if *action == "get" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be turned into a switch case block?
@@ -656,3 +656,17 @@ func (c *Client) FirmwareInstallUploaded(ctx context.Context, component, uploadV | |||
|
|||
return installTaskID, err | |||
} | |||
|
|||
// GetSystemEventLog queries for the SEL and returns the entries in an opinionated format. | |||
func (c *Client) GetSystemEventLog(ctx context.Context) (entries bmc.SystemEventLogEntries, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include tracing here, for an example, see -
Line 377 in 764ac9e
ctx, span := c.traceprovider.Tracer(pkgName).Start(ctx, "Close") |
bmc/sel.go
Outdated
continue | ||
} | ||
|
||
for i, v := range selRawEntries { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this block be pushed down into the provider implementations, since these 'boilerplate' methods should just be iterating over the providers and returning the result
internal/redfishwrapper/sel.go
Outdated
return nil, err | ||
} | ||
|
||
log.Println(len(logServices)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug print?
} | ||
|
||
// ID, Timestamp (date time), Description, Message (message : assertion) | ||
entries = append(entries, []string{line[0], fmt.Sprintf("%s %s", line[1], line[2]), line[3], fmt.Sprintf("%s : %s", line[4], line[5])}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this references elems in the slice line[3], line[4], line[5]
- it would be worth adding a len()
check before referencing those elem indexes.
line[i] = strings.TrimSpace(line[i]) | ||
} | ||
|
||
// ID, Timestamp (date time), Description, Message (message : assertion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you include some fixture data for this, along with a test for the parsing (move this scanner block into another method if that makes it easier to test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes and implementation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes and implementation!
(creds to GH vscode UI for the dup comment)
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