From 3bb1624fdd90ce943fcccbb2c3cc049245e47032 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Tue, 4 Jun 2024 00:51:47 -0500 Subject: [PATCH] ignore inactive arrays for now --- snmp/mdadm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snmp/mdadm b/snmp/mdadm index b0c9b3c5f..023af68a5 100755 --- a/snmp/mdadm +++ b/snmp/mdadm @@ -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")