[checkmk-commits] Check_MK Git: check_mk: #1993 FIX solaris_multipath: Fix detection of expected number of paths

Mathias Kettner mk at mathias-kettner.de
Mon Feb 16 13:28:17 CET 2015


Module: check_mk
Branch: master
Commit: 6eae8c038a8e472f4e51651b9982472a3bc599a5
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6eae8c038a8e472f4e51651b9982472a3bc599a5

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Mon Feb 16 13:27:56 2015 +0100

#1993 FIX solaris_multipath: Fix detection of expected number of paths

---

 .werks/1993              |   10 ++++++++++
 ChangeLog                |    1 +
 checks/solaris_multipath |   32 ++++++++++++++++++++------------
 3 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/.werks/1993 b/.werks/1993
new file mode 100644
index 0000000..61af534
--- /dev/null
+++ b/.werks/1993
@@ -0,0 +1,10 @@
+Title: solaris_multipath: Fix detection of expected number of paths
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424089642
+
+
diff --git a/ChangeLog b/ChangeLog
index de03927..d6d1576 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -158,6 +158,7 @@
     * 1940 FIX: ps: Fixed a rare crash on malformed agent output...
     * 1941 FIX: df.include: fixed exception on emtpy filesystems...
     * 1942 FIX: netapp_api_volumes: fixed exception when performance data generation was enabled
+    * 1993 FIX: solaris_multipath: Fix detection of expected number of paths
 
     Multisite:
     * 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/solaris_multipath b/checks/solaris_multipath
index ddca400..55d8afb 100644
--- a/checks/solaris_multipath
+++ b/checks/solaris_multipath
@@ -28,33 +28,41 @@
 # <<<solaris_multipath>>>
 # /dev/rdsk/c4t600601608CB02A00DCFD2EEB19A0E111d0s2 4 4
 
+# Note: the number of total paths is not correct. After maintainance
+# they is too high. Also in case of broken paths the number of total
+# paths sometimes changes. So we just use that for informational
+# output. The discovery remembers the number of operational paths
+# and we check agains that later.
+
 def inventory_solaris_multipath(info):
-    for device, total, ok in info:
+    for device, total, operational in info:
         item = device.split('/')[-1]
-        yield item, total
+        yield item, int(operational)
 
 def check_solaris_multipath(item, params, info):
-    for device, total, ok in info:
+    for device, total, operational in info:
         if item == device.split('/')[-1]:
 
-            ok    = int(ok)
-            total = int(total)
+            operational = int(operational)
+            total       = int(total)
+
+            infotext = "%d paths operational, %d paths total" % (operational, total)
 
             if not params:
                 state = 1
-                infotext = "%d paths up, but total paths unknown, redo service discovery" % ok
+                infotext += ", expected paths unknown, please redo service discovery"
             else:
-                itotal = int(params)
-                infotext = "%d of %d paths up" % (ok, itotal)
-                if total > itotal:
+                expected = int(params) # should be int, just for legacy reasons
+                if operational > expected:
                     state = 1
-                    infotext = "%d paths up, but total paths increased to %d, redo service discovery" % (ok, total)
-                elif itotal == ok:
+                elif expected == operational:
                     state = 0
-                elif itotal >= ok * 2: # less than half of paths ok
+                elif expected >= operational * 2: # less than half of paths operational
                     state = 2
                 else:
                     state = 1
+                if state:
+                    infotext += ", %d paths expected to be operational" % expected
 
             return state, infotext
 



More information about the checkmk-commits mailing list