Skip to content

feat: add raid mode for monitoring storage pool raid status#63

Open
animaartificialis wants to merge 4 commits into
wernerfred:masterfrom
animaartificialis:master
Open

feat: add raid mode for monitoring storage pool raid status#63
animaartificialis wants to merge 4 commits into
wernerfred:masterfrom
animaartificialis:master

Conversation

@animaartificialis

Copy link
Copy Markdown

Adds a raid mode that monitors the status of every Synology storage pool via SNMP. Behaviour:

raid_status mapping
1 (Normal) OK
2 (Repairing), 3 (Migrating), 4 (Expanding), 5 (Deleting), 6 (Creating), 7 (RaidSyncing), 8 (RaidParityChecking), 9 (RaidAssembling), 10 (Canceling) WARNING
11 (Degrade), 12 (Crashed) CRITICAL
anything else UNKNOWN

Notes:

  • The previous severity is preserved across iterations, so a WARNING pool can never lower the state below a CRITICAL one observed earlier in the loop.
  • Repairing(2) is included in the WARNING set (it's an intermediate operation, not a failure).
  • README updated with the new mode.

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).

animaartificialis and others added 3 commits May 20, 2026 21:48
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).
@animaartificialis

Copy link
Copy Markdown
Author

Pushed follow-up e5afb90: raid output now emits status=7 (RaidSyncing) instead of bare status=7. Labels derive from the comment block already documenting the codes. Suggested by an operator who hit status=7 in production and had to consult the MIB to interpret it.

If you'd prefer raid status labels (and the unrelated fa56408 storage threshold args from an earlier downstream patch) as separate PRs, happy to split — just let me know.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 raid mode that evaluates per–storage pool RAID status values and aggregates them into plugin state + perfdata.
  • Extend storage mode 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 raid mode 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.

Comment thread check_synology.py Outdated
Comment thread check_synology.py Outdated
Comment thread check_synology.py Outdated
Comment thread check_synology.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wernerfred wernerfred mentioned this pull request Jun 15, 2026
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.

4 participants