StorCLI plugin (MegaRAID)
The storcli plugin monitors LSI/Broadcom MegaRAID controllers, virtual drives (RAID volumes) and physical drives with StorCLI, the successor of the end-of-life MegaCLI utility. It reports health flags you can alert on, such as a degraded array, a failed disk or a SMART alert, along with temperatures and error counters.
Requirements
- A server with a MegaRAID controller (LSI / Avago / Broadcom).
- StorCLI installed (
storcli64orstorcli). Typical location:/opt/MegaRAID/storcli/storcli64. - Agent360 installed. The plugin needs
rootor a sudo rule, see below.
Setup
1. Check that StorCLI works
sudo /opt/MegaRAID/storcli/storcli64 /call show all JThis should print JSON. If it doesn't, fix StorCLI first.
2. Allow the agent to run StorCLI
The agent normally runs as the agent360 user. When it isn't root, the plugin runs StorCLI through sudo -n, which never prompts for a password, so it needs a sudoers rule.
Create /etc/sudoers.d/agent360-storcli (mode 0440) with the exact commands the plugin runs and nothing more:
Cmnd_Alias STORCLI_MON = \
/opt/MegaRAID/storcli/storcli64 /call show all J, \
/opt/MegaRAID/storcli/storcli64 /call/vall show all J, \
/opt/MegaRAID/storcli/storcli64 /call/eall/sall show all J
agent360 ALL=(root) NOPASSWD: STORCLI_MON
Replace the path with the output of which storcli64 if yours differs, then validate the file:
visudo -cf /etc/sudoers.d/agent360-storcliWhy not a plain
agent360 ALL=(ALL) NOPASSWD: /path/to/storcli64?
That lets theagent360user run any StorCLI command as root, including deleting virtual drives or erasing disks. Listing the exact arguments limits the agent to read-only queries.
3. Enable the plugin
Add to /etc/agent360.ini:
[storcli]
enabled = yes
; optional, only if StorCLI is not in a standard location
; binary = /opt/MegaRAID/storcli/storcli64Restart the agent, for example systemctl restart agent360.
4. Test
sudo -u agent360 agent360 test storcliYou should see controller_*, vd_* and pd_* entries. If you see an error string instead, check Troubleshooting.
Configuration
| Option | Default | Description |
|---|---|---|
enabled | no | Set to yes to turn the plugin on. |
binary | auto | Path to StorCLI. If unset, the plugin tries, in order: storcli64, storcli, /opt/MegaRAID/storcli/storcli64, /usr/sbin/storcli64. A configured value is tried first. |
Use the full path in binary and in the sudoers rule. The path in the sudoers rule has to match the binary that runs.
What it runs
All commands use StorCLI's JSON output (J) and are read-only:
storcli64 /call show all J
storcli64 /call/vall show all J
storcli64 /call/eall/sall show all J
A controller without virtual drives is not an error: the plugin still reports the controller and any physical drives.
Metrics
Every controller <c>, virtual drive <v>, enclosure <e> and slot <s> gets its own entry. A field that StorCLI doesn't report is returned as an empty string or 0.
controller_<c>
controller_<c>| Field | Description |
|---|---|
model | Controller model. |
status | Controller status as reported by StorCLI. |
optimal | 1 if the status is Optimal, otherwise 0. |
memory_correctable_errors | Correctable memory errors. |
memory_uncorrectable_errors | Uncorrectable memory errors. |
bbu_status | Battery backup unit status. May be a number or a string, depending on the controller. |
virtual_drives | Number of virtual drives. |
physical_drives | Number of physical drives. |
roc_temperature | RAID-on-chip temperature in °C. Only present if the controller reports it. |
vd_<c>_<v>
vd_<c>_<v>| Field | Description |
|---|---|
name | Virtual drive name. |
raid_level | RAID level, for example RAID1. |
size | Size as reported by StorCLI. |
state | State, for example Optl, Dgrd, Pdgd, OfLn. |
optimal | 1 if the state is Optl, otherwise 0. |
access | Access policy, for example RW. |
consistent | 1 if the drive is consistent, otherwise 0. |
stripe_size | Stripe size. |
number_of_drives | Drives per span. |
span_depth | Span depth. |
default_cache_policy | Default cache policy. |
current_cache_policy | Current cache policy. |
disk_cache_policy | Disk cache policy. |
encryption | Encryption status. |
pd_<c>_<e>_<s>
pd_<c>_<e>_<s>| Field | Description |
|---|---|
state | State, for example Onln, UGood, GHS, DHS, JBOD, Failed, UBad, Offln. |
healthy | 1 for Onln, UGood, GHS, DHS or JBOD, otherwise 0. |
media | Media type, for example HDD or SSD. |
interface | Interface, for example SAS or SATA. |
size | Size as reported by StorCLI. |
model | Drive model. |
media_error_count | Media error counter. |
other_error_count | Other error counter. |
predictive_failure_count | Predictive failure counter. |
smart_alert | 1 if the drive flagged a S.M.A.R.T. alert, otherwise 0. |
temperature | Drive temperature in °C. Only present if the drive reports it. |
Suggested alerts
| Condition | Meaning |
|---|---|
vd_*.optimal = 0 | A virtual drive is degraded, rebuilding or offline. |
pd_*.healthy = 0 | A physical drive failed, is offline or is in a bad state. |
pd_*.smart_alert = 1 | A drive reports an imminent failure. |
pd_*.predictive_failure_count > 0 | Drive predicts failure. |
controller_*.optimal = 0 | The controller reports a problem. |
controller_*.memory_uncorrectable_errors > 0 | Controller memory problem. |
pd_*.temperature or controller_*.roc_temperature high | Cooling problem. |
Troubleshooting
| Message / symptom | Cause and fix |
|---|---|
Could not find storcli binary | StorCLI isn't in PATH or a standard location. Install it or set binary = in [storcli]. |
Could not load storcli controller data | The /call show all query failed. Run the command from step 1. Common causes: the sudoers rule is missing or doesn't match the path or arguments (sudo -n fails without a password), or no MegaRAID controller is present. |
Works as root but not as agent360 | Sudoers problem. Run sudo -u agent360 sudo -n /opt/MegaRAID/storcli/storcli64 /call show all J. If it asks for a password or is denied, fix the rule and the path. |
Some fields are empty or 0 | StorCLI field names differ between versions and controller generations. Compare with the output of the commands above. |
No vd_* entries | The controller has no virtual drives configured (for example JBOD-only setups). |
Migrating from the MegaCLI plugin
The megacli plugin is not removed, but it only reported the last virtual drive and doesn't cover controllers or physical drives. storcli reports all virtual drives on all controllers, plus controller and physical-drive health.
The metric names are different, so existing graphs and alerts for megacli don't carry over. Recreate them with the metrics above.
Updated about 17 hours ago