Module: check_mk
Branch: master
Commit: 6a8d9ec2ba1cbf338e035a9828d9ded26e6c42a0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a8d9ec2ba1cbf…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Jan 23 20:44:29 2014 +0100
cmciii_lcp_waterflow: lower and upper limits to the flow are now monitored
---
.werks/572 | 9 +++++++++
ChangeLog | 1 +
checkman/cmciii_lcp_waterflow | 3 +++
checks/cmciii_lcp_waterflow | 25 ++++++++++++++++++-------
4 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/.werks/572 b/.werks/572
new file mode 100644
index 0000000..8a8834b
--- /dev/null
+++ b/.werks/572
@@ -0,0 +1,9 @@
+Title: cmciii_lcp_waterflow: lower and upper limits to the flow are now monitored
+Level: 1
+Component: checks
+Class: feature
+State: unknown
+Version: 1.2.5i1
+Date: 1390506211
+
+
diff --git a/ChangeLog b/ChangeLog
index a25baca..91c128b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@
* 0463 emcvnx_raidgroups.capacity, emcvnx_raidgroups.capacity_contiguous: New Checks
for EMC VNX Storage systems...
* 0570 fileinfo.groups: file groups now allow exclude patterns as well
* 0571 cmciii_lcp_fans: now monitors the lower limit for the rpm
+ * 0572 cmciii_lcp_waterflow: lower and upper limits to the flow are now monitored
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/cmciii_lcp_waterflow b/checkman/cmciii_lcp_waterflow
index 8345297..e9ef7d1 100644
--- a/checkman/cmciii_lcp_waterflow
+++ b/checkman/cmciii_lcp_waterflow
@@ -10,6 +10,9 @@ description:
taken as the state of the check as follows:
If the Rittal device returns {OK}, the check is {OK}. Otherwise
the check is {CRIT}.
+ Furthermore, the minimum and maximum flow limits of the device are
+ extracted and a state of {WARN} is assumed if the actual flow is
+ outside these limits.
item:
None
diff --git a/checks/cmciii_lcp_waterflow b/checks/cmciii_lcp_waterflow
index 910253a..9192c47 100644
--- a/checks/cmciii_lcp_waterflow
+++ b/checks/cmciii_lcp_waterflow
@@ -30,15 +30,26 @@ def inventory_cmciii_lcp_waterflow(info):
def check_cmciii_lcp_waterflow(item, params, info):
if info[0]:
- info_text = "%s Status: %s Flow: %s, MinFlow: %s, MaxFLow: %s" % \
- (info[0][0], info[0][4], info[0][1], info[0][3], info[0][2])
+ name = info[0][0]
+ status = info[0][4]
+ flow = float(info[0][1].split(" ")[0])
+ unit = info[0][1].split(" ")[1]
+ minflow= float(info[0][3].split(" ")[0])
+ maxflow = float(info[0][2].split(" ")[0])
- perfdata = [ ("flow", re.sub(" ", "", info[0][1]) ,
0, re.sub(' .*$', '', info[0][3])+":"+re.sub(' .*$',
'', info[0][2]), 0 ) ]
-
- if info[0][4].lower() == "ok":
- state = 0
- else:
+ sym = ""
+ if status.lower() != "ok":
state = 2
+ elif flow < minflow or flow > maxflow:
+ state = 1
+ sym = "(!)"
+ else:
+ state = 0
+
+ info_text = "%s Status: %s Flow: %.1f%s, MinFlow: %.1f, MaxFLow: %.1f"
\
+ % (name, status, flow, sym, minflow, maxflow)
+
+ perfdata = [ ("flow", str(flow)+unit ,
str(minflow)+":"+str(maxflow), 0, 0 ) ]
return (state, info_text, perfdata)