Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(go.d/megacli): handle BBU hardware component is not present #20008

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

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Mar 31, 2025

Summary

Fixes #20005

Test Plan
Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Mar 31, 2025
@ilyam8 ilyam8 requested a review from Copilot March 31, 2025 10:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses issue #20005 by modifying the megacli collector to handle cases where the BBU hardware component is not present. The changes introduce a new flag in the Collector struct to control BBU data collection and update the collection logic to disable BBU collection on error.

  • Added a new boolean flag (doBBU) in the Collector to toggle BBU collection.
  • Modified the collect function to disable BBU collection if an error occurs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/go/plugin/go.d/collector/megacli/collector.go Added the doBBU flag in both the constructor and the struct definition to enable conditional BBU collection.
src/go/plugin/go.d/collector/megacli/collect.go Updated the collection logic to conditionally attempt BBU collection and disable it upon failure.
Comments suppressed due to low confidence (1)

src/go/plugin/go.d/collector/megacli/collector.go:41

  • [nitpick] Consider renaming 'doBBU' to 'enableBBU' to more clearly indicate that this flag controls whether BBU collection is enabled.
doBBU:    true,

@ilyam8 ilyam8 merged commit fd97fd9 into netdata:master Mar 31, 2025
100 checks passed
@ilyam8 ilyam8 deleted the go.d-megacli-bbu branch March 31, 2025 11:19
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Mar 31, 2025
@stelfrag stelfrag mentioned this pull request Mar 31, 2025
Ferroin pushed a commit that referenced this pull request Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection area/go collectors/go.d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: megacli auto-detection fails if no battery is present on controller
2 participants