Skip to content

[CPCLOUD-6541] New Stor CLI plugin - #102

Merged
renakas merged 1 commit into
masterfrom
CPCLOUD-6541-new-plugin-stor-cli
Oct 30, 2026
Merged

renakas merged 1 commit into
masterfrom
CPCLOUD-6541-new-plugin-stor-cli

Conversation

@renakas

@renakas renakas commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

StorCLI plugin for Agent360 (replaces MegaCLI)

Background

The MegaCLI plugin (agent360/plugins/megacli.py) doesn't work correctly on some setups. MegaCLI itself reached end of life in 2013, with support ending in 2020. StorCLI is its successor.

Changes

File Change
agent360/plugins/storcli.py New plugin

Nothing else changed. megacli.py is left as is.

How it works

Commands run (all with J for JSON output):

  • storcli64 /call show all
  • storcli64 /call/vall show all
  • storcli64 /call/eall/sall show all

Binary lookup: binary = under [storcli] in /etc/agent360.ini, then storcli64, storcli, /opt/MegaRAID/storcli/storcli64 and /usr/sbin/storcli64.

Privileges: the plugin prefixes sudo -n when the agent isn't root. It needs a sudoers entry:

agent360 ALL=(ALL) NOPASSWD: /path/to/storcli64

Enable in /etc/agent360.ini:

[storcli]
enabled = yes
; binary = /opt/MegaRAID/storcli/storcli64

Reported metrics

Key Fields
controller_<c> model, status, optimal, memory correctable and uncorrectable errors, BBU status, virtual and physical drive counts, ROC temperature
vd_<c>_<v> name, RAID level, size, state, optimal, access, consistent, stripe size, number of drives, span depth, default, current and disk cache policy, encryption
pd_<c>_<e>_<s> state, healthy, media, interface, size, model, media, other and predictive-failure error counts, smart_alert, temperature

Differences from the MegaCLI plugin

  • Reports all virtual drives on all controllers. The old plugin kept only the last one because of a bug in its loop.
  • Adds controller and physical-drive health, which MegaCLI didn't cover.
  • Parses JSON instead of text lines.
  • Returns an error string if the binary is missing or the controller query fails. A controller with no virtual drives is not an error.
  • Output keys are new, so existing graphs and alerts for MegaCLI won't carry over.

Testing status

  • Parsing was tested against mock StorCLI JSON: a healthy and a degraded virtual drive, a good and a failed physical drive, and the missing-binary and failed-command paths. The file compiles.
  • Not tested on real MegaRAID hardware or with a real storcli64.
  • Before production use, run sudo -u agent360 agent360 test storcli on a real server.
  • StorCLI JSON field names vary a bit between versions and controller generations. A missing field gives an empty value or 0, but the field mapping is the most likely place for hardware testing to find problems.

Open points

  • Decide whether to deprecate megacli.py.
  • bbu_status is a number or a string depending on the controller.

@renakas
renakas requested a review from laurisb October 29, 2026 18:29
@renakas
renakas merged commit b47a126 into master Oct 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants