Module: check_mk
Branch: master
Commit: 126e1422af3f6615ab251e638e7245567a0a83f8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=126e1422af3f66…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 8 11:02:02 2014 +0200
FIX oracle_tablespaces: fixed bug when using dynamic filesystem levels
The check did not process the dynamic levels correctly.
If there was a rule with dynamic filesystem levels, e.g.
<ul>
<li>1 TB - 5%/2% free</li>
<li>500 GB - 6%/3% free</li>
<li>200 GB - 10%/4% free</li>
<li>500 MB - 20%/15% free</li>
</ul>
and the filesystems size was 700GB, the levels of the 500 MB rule were actually used.
---
.werks/789 | 18 ++++++++++++++++++
ChangeLog | 1 +
checks/oracle_tablespaces | 5 ++---
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/.werks/789 b/.werks/789
new file mode 100644
index 0000000..fda3da3
--- /dev/null
+++ b/.werks/789
@@ -0,0 +1,18 @@
+Title: oracle_tablespaces: fixed bug when using dynamic filesystem levels
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i3
+Date: 1396947332
+
+The check did not process the dynamic levels correctly.
+If there was a rule with dynamic filesystem levels, e.g.
+<ul>
+<li>1 TB - 5%/2% free</li>
+<li>500 GB - 6%/3% free</li>
+<li>200 GB - 10%/4% free</li>
+<li>500 MB - 20%/15% free</li>
+</ul>
+and the filesystems size was 700GB, the levels of the 500 MB rule were actually used.
+
diff --git a/ChangeLog b/ChangeLog
index c2abeee..05ade8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* 0787 FIX: df: fixed problems on some filesystem checks when legacy check parameters
where used...
* 0803 FIX: agent_ibmsvc: raw data for System Info Check and License Check now in
correct format...
* 0788 FIX: oracle_tablespaces: now able to bear None values as warn/crit levels...
+ * 0789 FIX: oracle_tablespaces: fixed bug when using dynamic filesystem levels...
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled
by filter)
diff --git a/checks/oracle_tablespaces b/checks/oracle_tablespaces
index 7ed2eec..ca850cf 100644
--- a/checks/oracle_tablespaces
+++ b/checks/oracle_tablespaces
@@ -102,12 +102,11 @@ def get_tablespace_levels_in_bytes(size_bytes, params):
else:
# A list of levels. Choose the correct one depending on the
# size of the current tablespace
- found = False
for to_size, this_levels in params.get("levels"):
if size_bytes > to_size:
warn, crit = this_levels
- found = True
- if not found:
+ break
+ else:
return (None, None)
if magic: