cmciii_lcp_waterin, cmciii_lcp_waterout:
checks now observe limits to
the temperatures
Message-ID: <52e17f80.t6yEATQNsA0k217d%gg(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Module: check_mk
Branch: master
Commit: 1d63ba2f23b9efa4508433e1724399450fb8f32f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1d63ba2f23b9ef…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Jan 23 21:43:15 2014 +0100
cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout: checks now
observe limits to the temperatures
---
.werks/573 | 9 +++++++++
ChangeLog | 1 +
checkman/cmciii_lcp_airin | 3 +++
checkman/cmciii_lcp_airout | 3 +++
checkman/cmciii_lcp_waterin | 4 ++++
checkman/cmciii_lcp_waterout | 4 ++++
checks/cmciii_lcp_airin | 24 +++++++++++++++++-------
checks/cmciii_lcp_airout | 24 +++++++++++++++++-------
checks/cmciii_lcp_waterin | 25 ++++++++++++++++++-------
checks/cmciii_lcp_waterout | 25 ++++++++++++++++++-------
10 files changed, 94 insertions(+), 28 deletions(-)
diff --git a/.werks/573 b/.werks/573
new file mode 100644
index 0000000..5bb68c0
--- /dev/null
+++ b/.werks/573
@@ -0,0 +1,9 @@
+Title: cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout:
checks now observe limits to the temperatures
+Level: 1
+Component: checks
+Class: feature
+State: unknown
+Version: 1.2.5i1
+Date: 1390509708
+
+
diff --git a/ChangeLog b/ChangeLog
index 91c128b..ae585a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,7 @@
* 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
+ * 0573 cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout:
checks now observe limits to the temperatures
* 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_airin b/checkman/cmciii_lcp_airin
index ee09805..e0f444f 100644
--- a/checkman/cmciii_lcp_airin
+++ b/checkman/cmciii_lcp_airin
@@ -13,6 +13,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 lower and upper warning and critical limits configured
+ in the device are extracted and used as limimts for the
+ average temperature read from the device.
item:
None
diff --git a/checkman/cmciii_lcp_airout b/checkman/cmciii_lcp_airout
index 048a30b..98ff81a 100644
--- a/checkman/cmciii_lcp_airout
+++ b/checkman/cmciii_lcp_airout
@@ -13,6 +13,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 lower and upper warning and critical limits configured
+ in the device are extracted and used as limimts for the
+ average temperature read from the device.
item:
None
diff --git a/checkman/cmciii_lcp_waterin b/checkman/cmciii_lcp_waterin
index 1025247..8e754f4 100644
--- a/checkman/cmciii_lcp_waterin
+++ b/checkman/cmciii_lcp_waterin
@@ -11,6 +11,10 @@ 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 lower and upper warning and critical limits configured
+ in the device are extracted and used as limimts for the
+ temperature read from the device.
+
item:
None
diff --git a/checkman/cmciii_lcp_waterout b/checkman/cmciii_lcp_waterout
index 8420c91..55c90de 100644
--- a/checkman/cmciii_lcp_waterout
+++ b/checkman/cmciii_lcp_waterout
@@ -11,6 +11,10 @@ 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 lower and upper warning and critical limits configured
+ in the device are extracted and used as limimts for the
+ temperature read from the device.
+
item:
None
diff --git a/checks/cmciii_lcp_airin b/checks/cmciii_lcp_airin
index 555e97b..1f98955 100644
--- a/checks/cmciii_lcp_airin
+++ b/checks/cmciii_lcp_airin
@@ -38,18 +38,28 @@ def check_cmciii_lcp_airin(item, params, info):
unit_desc, unit_status, desc, status = info[0][0:4]
temps = extract_temps(info[0][4:])
- info_text = "%s %s %s %s, Temp.Average: %.1f°C, Top/Mid/Bottom:
%.1f/%.1f/%.1f" % \
- (unit_desc, unit_status, desc, status, temps[4], temps[5], temps[6],
temps[7])
+ state = 0
+ if status.lower() != "ok" or unit_status.lower() != "ok":
+ state = 2
+ sym = ""
+
+ if temps[4] < temps[0] or temps[4] > temps[3] :
+ state = 2
+ sym = "(!!)"
+ elif temps[4] < temps[1] or temps[4] > temps[2]:
+ state = max(state, 1)
+ sym = "(!)"
+ else:
+ state = max(state, 0)
+ sym = ""
+
+ info_text = "%s %s %s %s, Temp.Average: %.1f°C%s, Top/Mid/Bottom:
%.1f/%.1f/%.1f" % \
+ (unit_desc, unit_status, desc, status, temps[4], sym, temps[5],
temps[6], temps[7])
levels_text = ", lowcrit/lowwarn/highwarn/highcrit: %.1f/%.1f/%.1f/%.1f" %
( temps[0], temps[1], temps[2], temps[3] )
perfdata = [ ("temp", temps[4], str(temps[1])+":"+str(temps[2]),
str(temps[0])+":"+str(temps[3]), 0 ) ]
- if status.lower() == "ok" and unit_status.lower() == "ok":
- state = 0
- else:
- state = 2
-
return (state, info_text + levels_text, perfdata)
check_info['cmciii_lcp_airin'] = {
diff --git a/checks/cmciii_lcp_airout b/checks/cmciii_lcp_airout
index b6100b5..041c16d 100644
--- a/checks/cmciii_lcp_airout
+++ b/checks/cmciii_lcp_airout
@@ -38,18 +38,28 @@ def check_cmciii_lcp_airout(item, params, info):
unit_desc, unit_status, desc, status = info[0][0:4]
temps = extract_temps(info[0][4:])
- info_text = "%s %s %s %s, Temp.Average: %.1f°C, Top/Mid/Bottom:
%.1f/%.1f/%.1f" % \
- (unit_desc, unit_status, desc, status, temps[4], temps[5], temps[6],
temps[7])
+ state = 0
+ if status.lower() != "ok" or unit_status.lower() != "ok":
+ state = 2
+ sym = ""
+
+ if temps[4] < temps[0] or temps[4] > temps[3] :
+ state = 2
+ sym = "(!!)"
+ elif temps[4] < temps[1] or temps[4] > temps[2]:
+ state = max(state, 1)
+ sym = "(!)"
+ else:
+ state = max(state, 0)
+ sym = ""
+
+ info_text = "%s %s %s %s, Temp.Average: %.1f°C%s, Top/Mid/Bottom:
%.1f/%.1f/%.1f" % \
+ (unit_desc, unit_status, desc, status, temps[4], sym, temps[5],
temps[6], temps[7])
levels_text = ", lowcrit/lowwarn/highwarn/highcrit: %.1f/%.1f/%.1f/%.1f" %
( temps[0], temps[1], temps[2], temps[3] )
perfdata = [ ("temp", temps[4], str(temps[1])+":"+str(temps[2]),
str(temps[0])+":"+str(temps[3]), 0 ) ]
- if status.lower() == "ok" and unit_status.lower() == "ok":
- state = 0
- else:
- state = 2
-
return (state, info_text + levels_text, perfdata)
check_info['cmciii_lcp_airout'] = {
diff --git a/checks/cmciii_lcp_waterin b/checks/cmciii_lcp_waterin
index 95c8249..009ef5d 100644
--- a/checks/cmciii_lcp_waterin
+++ b/checks/cmciii_lcp_waterin
@@ -41,17 +41,28 @@ def check_cmciii_lcp_waterin(item, params, info):
temp = limits.pop(0)
status = info[0][9]
- info_text = "%s %s, %s %s, Temperature: %.1f°C" % (unit_desc, unit_status,
desc, status, temp)
+ state = 0
+ if status.lower() != "ok" or unit_status.lower() != "ok":
+ state = 2
+ sym = ""
- levels_text = ", limits lowcrit/lowwarn/highwarn/highcrit:
%.1f/%.1f/%.1f/%.1f" % ( limits[3], limits[2], limits[1], limits[0] )
+ if temp < limits[3] or temp > limits[0] :
+ state = 2
+ sym = "(!!)"
+ elif temp < limits[2] or temp > limits[1]:
+ state = max(state, 1)
+ sym = "(!)"
+ else:
+ state = max(state, 0)
+ sym = ""
- perfdata = [ ("temp", temp, str(limits[2])+":"+str(limits[1]),
str(limits[3])+":"+str(limits[0]), 0 ) ]
+ info_text = "%s %s, %s %s, Temperature: %.1f°C%s" \
+ % (unit_desc, unit_status, desc, status, temp, sym)
+ levels_text = ", lowcrit/lowwarn/highwarn/highcrit: %.1f/%.1f/%.1f/%.1f" \
+ % ( limits[3], limits[2], limits[1], limits[0] )
- if status.lower() == "ok" and unit_status.lower() == "ok":
- state = 0
- else:
- state = 2
+ perfdata = [ ("temp", temp, str(limits[2])+":"+str(limits[1]),
str(limits[3])+":"+str(limits[0]), 0 ) ]
return (state, info_text + levels_text, perfdata)
diff --git a/checks/cmciii_lcp_waterout b/checks/cmciii_lcp_waterout
index ddf950f..fa3ef91 100644
--- a/checks/cmciii_lcp_waterout
+++ b/checks/cmciii_lcp_waterout
@@ -41,17 +41,28 @@ def check_cmciii_lcp_waterout(item, params, info):
temp = limits.pop(0)
status = info[0][9]
- info_text = "%s %s, %s %s, Temperature: %.1f°C" % (unit_desc, unit_status,
desc, status, temp)
+ state = 0
+ if status.lower() != "ok" or unit_status.lower() != "ok":
+ state = 2
+ sym = ""
- levels_text = ", limits lowcrit/lowwarn/highwarn/highcrit:
%.1f/%.1f/%.1f/%.1f" % ( limits[3], limits[2], limits[1], limits[0] )
+ if temp < limits[3] or temp > limits[0] :
+ state = 2
+ sym = "(!!)"
+ elif temp < limits[2] or temp > limits[1]:
+ state = max(state, 1)
+ sym = "(!)"
+ else:
+ state = max(state, 0)
+ sym = ""
- perfdata = [ ("temp", temp, str(limits[2])+":"+str(limits[1]),
str(limits[3])+":"+str(limits[0]), 0 ) ]
+ info_text = "%s %s, %s %s, Temperature: %.1f°C%s" \
+ % (unit_desc, unit_status, desc, status, temp, sym)
+ levels_text = ", lowcrit/lowwarn/highwarn/highcrit: %.1f/%.1f/%.1f/%.1f" \
+ % ( limits[3], limits[2], limits[1], limits[0] )
- if status.lower() == "ok" and unit_status.lower() == "ok":
- state = 0
- else:
- state = 2
+ perfdata = [ ("temp", temp, str(limits[2])+":"+str(limits[1]),
str(limits[3])+":"+str(limits[0]), 0 ) ]
return (state, info_text + levels_text, perfdata)