Skip to content

Commit

Permalink
Merge pull request #522 from VVelox/mdadm_inactive
Browse files Browse the repository at this point in the history
ignore inactive arrays for now
  • Loading branch information
VVelox authored Jun 4, 2024
2 parents 5684862 + 3bb1624 commit f88bf23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snmp/mdadm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# MDADM SNMP extension for LibreNMS
# Version
extendVer='2.0.0'
extendVer='2'
# Initial portion of json
mdadmSNMPOutput='{ "data": ['

@@ -40,6 +40,10 @@ main() {
[[ "${mdadmArray}" =~ '/dev/md'[[:digit:]]+'p' ]] && continue

mdadmName="$(basename "$(realpath "${mdadmArray}")")"

# Ignore inactive arrays
[[ $(grep "^${mdadmName}" /proc/mdstat) =~ 'inactive' ]] && continue

mdadmSysDev="/sys/block/${mdadmName}"

degraded=$(maybe_get "${mdadmSysDev}/md/degraded")

0 comments on commit f88bf23

Please sign in to comment.