ArielGlenn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/80055


Change subject: account for hosts where every disk is raid 0 (e.g. the ms-be 
hosts)
......................................................................

account for hosts where every disk is raid 0 (e.g. the ms-be hosts)

Change-Id: I3e18053cc4e895bfd3a8ed2241b549d7cc124e0c
---
M files/icinga/check-raid.py
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/55/80055/1

diff --git a/files/icinga/check-raid.py b/files/icinga/check-raid.py
index da57c52..97691b7 100755
--- a/files/icinga/check-raid.py
+++ b/files/icinga/check-raid.py
@@ -230,8 +230,10 @@
 
     stateRegex = re.compile('^State\s*:\s*([^\n]*)')
     drivesRegex = re.compile('^Number Of Drives( per span)?\s*:\s*([^\n]*)')
+    configuredRegex = re.compile('^Adapter \d+: No Virtual Drive Configured')
     state = None
     numDrives = None
+    configured = True
     for line in proc.stdout:
         m = stateRegex.match(line)
         if m is not None:
@@ -243,14 +245,23 @@
             numDrives = int(m.group(2))
             continue
 
+        c = configuredRegex.match(line)
+        if c is not None:
+            configured = False
+            continue
+
     ret = proc.wait()
     if ret != 0:
         print 'WARNING: MegaCli64 returned exit status %d' % (ret)
         return 1
 
     if numDrives is None:
-        print 'WARNING: Parse error processing MegaCli64 output'
-        return 1
+        if configured:
+            print 'WARNING: Parse error processing MegaCli64 output'
+            return 1
+        else:
+            print 'OK: No disks configured for RAID'
+            return 0
 
     if state != 'Optimal':
         print 'CRITICAL: %s' % (state)

-- 
To view, visit https://gerrit.wikimedia.org/r/80055
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e18053cc4e895bfd3a8ed2241b549d7cc124e0c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to