feat: add raid mode for monitoring storage pool raid status#63
feat: add raid mode for monitoring storage pool raid status#63animaartificialis wants to merge 5 commits into
Conversation
Adds a `raid` mode that surfaces Synology raid status (OID 1.3.6.1.4.1.6574.3.1.1.x) for every storage pool: Normal → OK, intermediate states (Repairing/Migrating/Expanding/.../Canceling) → WARNING, Degrade and Crashed → CRITICAL, anything else → UNKNOWN. The previous severity is preserved across iterations so a WARNING pool can never downgrade a CRITICAL one. Status "2" (Repairing) is included in the WARNING set. README updated with the new mode. This is an alternative take on wernerfred#62 incorporating review feedback from issuecomment-4502847249.
- New --warning-free / --critical-free args: PERC_FREE thresholds (check_disk -w/-c convention). Precedence over upstream -w/-c. - Storage perfdata gets `;;;0;<storage_size>` (value;warn;crit;min;max) so Graphite-backed forecast plugins can compute 'days until full'. Backwards-compatible. _parse_pct accepts '10', '10%', ' 5 % '. Patch from Imatic IT; 6 threshold scenarios verified locally.
Previously emitted `status=7` only — opaque without consulting the MIB. Now emits `status=7 (RaidSyncing)` using a mapping derived from the comment block already documenting the codes. Suggested by Imatic IT (operator hit status=7 in production, had to look up the meaning manually).
|
Pushed follow-up If you'd prefer raid status labels (and the unrelated |
There was a problem hiding this comment.
Pull request overview
Adds a new raid monitoring mode to check_synology.py to report Synology storage pool RAID status via SNMP, and extends storage threshold handling to support “free %” thresholds in a check_disk-like style.
Changes:
- Add
raidmode that evaluates per–storage pool RAID status values and aggregates them into plugin state + perfdata. - Extend
storagemode thresholds to support--warning-free/--critical-free(PERC_FREE), falling back to existing-w/-c(PERC_USED). - Update storage perfdata to include a max value (storage size) and document the new
raidmode in the README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Documents the new raid mode in the available modes table. |
| check_synology.py | Adds raid mode, enhances storage threshold parsing/logic, and improves storage perfdata output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Status 13 (DataScrubbing) and 14-20 (RaidDeploying, RaidUnDeploying, RaidMountCache, RaidUnmountCache, RaidExpandingUnfinishedSHR, RaidConvertSHRToPool, RaidMigrateSHR1ToSHR2) are transient maintenance operations from SYNOLOGY-RAID-MIB. Previously they fell through to UNKNOWN; they now map to WARNING alongside the existing transitional states (Repairing, RaidSyncing, RaidParityChecking, ...), so an ongoing data scrub no longer alerts as UNKNOWN. Status 21 (RaidUnknownStatus) is added to the label map but deliberately left out of WARNING_STATUSES so genuinely unknown states still surface as UNKNOWN per the Nagios convention.
Adds a
raidmode that monitors the status of every Synology storage pool via SNMP. Behaviour:Notes:
WARNINGpool can never lower the state below aCRITICALone observed earlier in the loop.Repairing(2)is included in the WARNING set (it's an intermediate operation, not a failure).This is an alternative implementation of #62 that addresses the issues raised in #62 (comment) (severity downgrade, missing status
2, README↔code mismatch, explicit Degrade/Crashed classification).