[checkmk-commits] Check_MK Git: check_mk: A few cleanups in the datacore checks

Mathias Kettner mk at mathias-kettner.de
Mon Feb 2 12:21:44 CET 2015


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

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Mon Feb  2 12:21:30 2015 +0100

A few cleanups in the datacore checks

---

 checks/datacore_alerts                            |    5 +++--
 checks/{datacore_poolallocation => datacore_pool} |   24 ++++++++++-----------
 checks/datacore_poolstatus                        |    2 +-
 checks/datacore_ports                             |   14 ++++++------
 checks/datacore_serverstatus                      |    4 ++--
 checks/datacore_virtualdiskstatus                 |    8 +++----
 6 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/checks/datacore_alerts b/checks/datacore_alerts
index 94fff08..c05f9ec 100644
--- a/checks/datacore_alerts
+++ b/checks/datacore_alerts
@@ -24,7 +24,7 @@
 # to the free software foundation, inc., 51 franklin st,  fifth floor,
 # boston, ma 02110-1301 usa.
 
-datacore_alerts_default_values = (1,2)
+datacore_alerts_default_values = (1, 2)
 
 def inventory_datacore_alerts(info):
     return [ (None, "datacore_alerts_default_values") ]
@@ -34,7 +34,7 @@ def check_datacore_alerts(_no_item, params, info):
     warn, crit = params
     nr_of_alerts = int(info[0][0])
     perfdata = [ ( "alerts", nr_of_alerts, warn, crit ) ]
-    infotxt = "There are %d unacknowlegded alerts" % nr_of_alerts
+    infotxt = "Unacknowlegded alerts: %d" % nr_of_alerts
     levels = " (levels at %d/%d)" % (warn, crit)
 
     state = 0
@@ -46,6 +46,7 @@ def check_datacore_alerts(_no_item, params, info):
         infotxt += levels
     return state, infotxt, perfdata
 
+
 check_info["datacore_alerts"] = {
     "check_function"        : check_datacore_alerts,
     "inventory_function"    : inventory_datacore_alerts,
diff --git a/checks/datacore_poolallocation b/checks/datacore_pool
similarity index 73%
rename from checks/datacore_poolallocation
rename to checks/datacore_pool
index bd31f9c..efe518a 100644
--- a/checks/datacore_poolallocation
+++ b/checks/datacore_pool
@@ -24,20 +24,20 @@
 # to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
 # Boston, MA 02110-1301 USA.
 
-datacore_poolallocation_default_values = (80, 90)
+datacore_pool_default_values = (80, 90)
 
-def inventory_datacore_poolallocation(info):
+def inventory_datacore_pool(info):
     for line in info:
-        yield line[0], "datacore_poolallocation_default_values"
+        yield line[0], "datacore_pool_default_values"
 
-def check_datacore_poolallocation(item, params, info):
+def check_datacore_pool(item, params, info):
     warn, crit = params
     for poolname, allocated in info:
         if poolname == item:
             allocated = int(allocated)
-            infotxt = "Poolallocation is at %.0f %%"  % allocated
-            levels = " (levels at %.0f %%/%.0f %%)" % (warn, crit)
-            perfdata = [("allocated", allocated, warn, crit)]
+            infotxt = "Pool allocation: %d%%"  % allocated
+            levels = " (levels at %d/%d%%)" % (warn, crit)
+            perfdata = [("pool_allocation", allocated, warn, crit)]
 
             state = 0
             if allocated >= crit:
@@ -48,10 +48,10 @@ def check_datacore_poolallocation(item, params, info):
                 infotxt += levels
             return state, infotxt, perfdata
 
-check_info['datacore_poolallocation'] = {
-    "check_function"          : check_datacore_poolallocation,
-    "inventory_function"      : inventory_datacore_poolallocation,
-    "service_description"     : "DataCore Poolallocation %s",
+check_info['datacore_pool'] = {
+    "check_function"          : check_datacore_pool,
+    "inventory_function"      : inventory_datacore_pool,
+    "service_description"     : "DataCore Pool %s",
     "has_perfdata"            : True,
-    "group"                   : "datacore_poolallocation",
+    "group"                   : "datacore_pool",
 }
diff --git a/checks/datacore_poolstatus b/checks/datacore_poolstatus
index ff1a8f7..dd4f674 100644
--- a/checks/datacore_poolstatus
+++ b/checks/datacore_poolstatus
@@ -45,5 +45,5 @@ def check_datacore_poolstatus(item, _no_params, info):
 check_info['datacore_poolstatus'] = {
     "check_function"          : check_datacore_poolstatus,
     "inventory_function"      : inventory_datacore_poolstatus,
-    "service_description"     : "DataCore Diskpool %s",
+    "service_description"     : "DataCore Disk Pool %s",
 }
diff --git a/checks/datacore_ports b/checks/datacore_ports
index 7745f4d..88aa89e 100644
--- a/checks/datacore_ports
+++ b/checks/datacore_ports
@@ -24,13 +24,13 @@
 # to the free software foundation, inc., 51 franklin st,  fifth floor,
 # boston, ma 02110-1301 usa.
 
-#<<<datacore_ports>>>
-#shdesolssy01_FE1 FibreChannel True
-#Server_FC_Port_2 FibreChannel True
-#Server_FC_Port_3 FibreChannel False
-#Server_FC_Port_4 FibreChannel True
-#Server_iSCSI_Port_1 iSCSI True
-#Microsoft_iSCSI-Initiator iSCSI True
+# <<<datacore_ports>>>
+# shdesolssy01_FE1 FibreChannel True
+# Server_FC_Port_2 FibreChannel True
+# Server_FC_Port_3 FibreChannel False
+# Server_FC_Port_4 FibreChannel True
+# Server_iSCSI_Port_1 iSCSI True
+# Microsoft_iSCSI-Initiator iSCSI True
 
 def inventory_datacore_ports(info):
     for portname, porttype, portstatus in info:
diff --git a/checks/datacore_serverstatus b/checks/datacore_serverstatus
index 4ee265b..56fe8d8 100644
--- a/checks/datacore_serverstatus
+++ b/checks/datacore_serverstatus
@@ -24,8 +24,8 @@
 # to the free software foundation, inc., 51 franklin st,  fifth floor,
 # boston, ma 02110-1301 usa.
 
-#<<<datacore_serverstatus>>>
-#Online WritebackGlobal
+# <<<datacore_serverstatus>>>
+# Online WritebackGlobal
 
 def inventory_datacore_serverstatus(info):
     return [(None, None)]
diff --git a/checks/datacore_virtualdiskstatus b/checks/datacore_virtualdiskstatus
index 97506ac..b1b9a7f 100644
--- a/checks/datacore_virtualdiskstatus
+++ b/checks/datacore_virtualdiskstatus
@@ -24,9 +24,9 @@
 # to the free software foundation, inc., 51 franklin st,  fifth floor,
 # boston, ma 02110-1301 usa.
 
-#<<<datacore_virtualdiskstatus>>>
-#testvmfs01 Online
-#vmfs10 Online
+# <<<datacore_virtualdiskstatus>>>
+# testvmfs01 Online
+# vmfs10 Online
 
 def inventory_datacore_virtualdiskstatus(info):
    for line in info:
@@ -43,5 +43,5 @@ def check_datacore_virtualdiskstatus(item, _no_params, info):
 check_info['datacore_virtualdiskstatus'] = {
     "check_function"          : check_datacore_virtualdiskstatus,
     "inventory_function"      : inventory_datacore_virtualdiskstatus,
-    "service_description"     : "DataCore VirtualDisk %s",
+    "service_description"     : "DataCore Virtual Disk %s",
 }



More information about the checkmk-commits mailing list