Module: check_mk
Branch: master
Commit: 59977b58d6a5ae55bd4e9b4cee64e61445efb3ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=59977b58d6a5ae…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Jul 6 16:25:09 2015 +0200
#2449 FIX db2_mem: Fixed scaling of perfdata
Previously, this check would in many cases misinterpret KB as Bytes.
This has been fixed.
---
.werks/2449 | 11 +++++++++++
ChangeLog | 1 +
checks/db2_mem | 8 +++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/2449 b/.werks/2449
new file mode 100644
index 0000000..8c04103
--- /dev/null
+++ b/.werks/2449
@@ -0,0 +1,11 @@
+Title: db2_mem: Fixed scaling of perfdata
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1436192652
+
+Previously, this check would in many cases misinterpret KB as Bytes.
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index c0bf304..f7d101d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,7 @@
* 2320 FIX: winperf_msx_queues: no longer crashes in service discovery if there are
no msx queues available
* 2321 FIX: process discovery: fixed exception during service discovery when no
explicit process matching was set...
* 2394 FIX: megaraid_ldisks: Is now supporting LSI CacheCade drives
+ * 2449 FIX: db2_mem: Fixed scaling of perfdata...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/db2_mem b/checks/db2_mem
index 8e5c322..8a47db3 100644
--- a/checks/db2_mem
+++ b/checks/db2_mem
@@ -39,7 +39,13 @@ def check_db2_mem(item, params, info):
for line in info:
if hit > 0 and hit <= 2:
hit += 1
- values.append(saveint(line[-2]))
+ if line[-1].lower() == "kb":
+ value = int(line[-2]) * 1024
+ elif line[-1].lower() == "mb":
+ value = int(line[-2]) * 1024 * 1024
+ else:
+ value = int(line[-2])
+ values.append(value)
if len(values) == 2:
limit, usage = values
left = limit - usage