Module: check_mk
Branch: master
Commit: 8c901d5c5bd27cb07c147aa26b4843f3af168285
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c901d5c5bd27c…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Jan 23 20:25:18 2014 +0100
cmciii_lcp_fans: now monitors the lower limit for the rpm
---
.werks/571 | 9 +++++++++
ChangeLog | 2 +-
checkman/cmciii_lcp_fans | 2 ++
checks/cmciii_lcp_fans | 25 +++++++++++++++++--------
4 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/.werks/571 b/.werks/571
new file mode 100644
index 0000000..c67eb70
--- /dev/null
+++ b/.werks/571
@@ -0,0 +1,9 @@
+Title: cmciii_lcp_fans: now monitors the lower limit for the rpm
+Level: 1
+Component: checks
+Class: feature
+State: unknown
+Version: 1.2.5i1
+Date: 1390505063
+
+
diff --git a/ChangeLog b/ChangeLog
index ff848c2..a25baca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,7 @@
* 0462 emcvnx_raidgroups.list_disks: New check for EMC VNX storage system...
* 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
* 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...
@@ -171,7 +172,6 @@
* 0428 Changed user profiles (e.g. pw changes) are now replicated in distributed
setups...
* 0114 User Custom Attributes can now be exported to the core...
* 0448 New button in WATO service list for displaying check parameters...
- * 0353 New button in service list for refreshing all services...
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
* 0241 FIX: Improved sorting of WATO folders in dropdown menu...
* 0019 FIX: Fixed wording in WATO rule for MSSQL check
diff --git a/checkman/cmciii_lcp_fans b/checkman/cmciii_lcp_fans
index 9f63824..5200b70 100644
--- a/checkman/cmciii_lcp_fans
+++ b/checkman/cmciii_lcp_fans
@@ -11,6 +11,8 @@ 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}.
+ Futhermore, the global lower limit for the fan RPM is extracted from
+ the device. If the fan RPM is below this limit, the check is {WARN}.
item:
The number of the fan
diff --git a/checks/cmciii_lcp_fans b/checks/cmciii_lcp_fans
index 40e581b..8f56bd7 100644
--- a/checks/cmciii_lcp_fans
+++ b/checks/cmciii_lcp_fans
@@ -33,21 +33,30 @@ def inventory_cmciii_lcp_fans(info):
return inventory
def check_cmciii_lcp_fans(item, params, info):
- for i in range(1,7):
- if item == i:
- status = info[0][i*4-1]
- lowlevel = re.sub(" .*$", "", info[0][0])
- info_text = "%s RPM: %s, Status: %s" % \
- (info[0][i*4-3], info[0][i*4-2], info[0][i*4-1])
+ lowlevel = int(re.sub(" .*$", "", info[0][0])) # global low
warning
- perfdata = [ ("rpm", re.sub(" ","",
info[0][i*4-2]), lowlevel+":", 0, 0 ) ]
+ for i in range(1,7):
+ if item == i:
+ name = info[0][i*4-3]
+ status = info[0][i*4-1].lower()
+ rpm = int(info[0][i*4-2].split(" ")[0])
+ unit = info[0][i*4-2].split(" ")[1]
- if status.lower() == "ok":
+ sym = ""
+ if status == "ok" and rpm >= lowlevel:
state = 0
+ elif ( status == "ok" and rpm < lowlevel ):
+ state = 1
+ sym = "(!)"
else:
state = 2
+ info_text = "%s RPM: %d%s (limit %d%s)%s, Status %s" \
+ % (name, rpm, unit, lowlevel, unit, sym, status)
+
+ perfdata = [ ("rpm", str(rpm)+unit, str(lowlevel)+":", 0,
0 ) ]
+
return (state, info_text, perfdata)
return (3, "no SNMP data found")