Module: check_mk
Branch: master
Commit: 3e1144e9dcbec0c09fab1186c23e48d7772bb9e7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e1144e9dcbec0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Nov 25 10:49:02 2016 +0100
4093 FIX oracle_tablespaces: Werk 3907 broke the space calculation
The calculation of free and used space in Oracle is very complicated
when autoextend is used due to some special situations.
---
.werks/4093 | 11 +++++++++++
ChangeLog | 1 +
checks/oracle_tablespaces | 16 ++++++----------
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/.werks/4093 b/.werks/4093
new file mode 100644
index 0000000..090c6f0
--- /dev/null
+++ b/.werks/4093
@@ -0,0 +1,11 @@
+Title: oracle_tablespaces: Werk 3907 broke the space calculation
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1480067305
+
+The calculation of free and used space in Oracle is very complicated
+when autoextend is used due to some special situations.
diff --git a/ChangeLog b/ChangeLog
index d9711d2..cc8ecf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,7 @@
* 4091 FIX: oracle_tablespace: Werk 3907 broke the detection of UNDO- and TEMP-Tablespaces
* 4069 FIX: cmciii.phase: Fixed broken check with some devices...
* 4092 FIX: if.include: fixed wrong calculated number of interfaces which are up in case of interface groups
+ * 4093 FIX: oracle_tablespaces: Werk 3907 broke the space calculation...
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/oracle_tablespaces b/checks/oracle_tablespaces
index db179a1..c0ee1b5 100644
--- a/checks/oracle_tablespaces
+++ b/checks/oracle_tablespaces
@@ -270,7 +270,8 @@ def check_oracle_tablespaces(item, params, parsed):
if df_size > df_max_size:
max_size += df_size
- free_extension = df_size - df_max_size # free extension space
+ # current file size > df_max_size => no more extents available
+ free_extension = 0
else:
max_size += df_max_size
free_extension = df_max_size - df_size # free extension space
@@ -278,20 +279,15 @@ def check_oracle_tablespaces(item, params, parsed):
if incsize == datafile["block_size"]:
uses_default_increment = True
- #incs, rest = divmod(free_extension, incsize)
- #if rest:
- # # ??? Was ist, wenn es nicht genau aufgeht und ein weiteres
- # # increment max_size überschreiten würde? Das geht ja wohl
- # # nicht oder??
- # # incs += 1 ### Dann würde max_size überschritten!
incs = free_extension / incsize
num_increments += incs
increment_size += incsize * incs
if db_version >= 11:
- # The size of next extent in datafile is ignored when remaining
- # free space is > then next extend. Oracle uses all space up to the maximum!
- free_space += df_max_size - df_size
+ # Newer versions of Oracle uses every time the remaining space of the
+ # datafile. There is no need for calculation of remaing space with
+ # next extend anymore!
+ free_space += free_extension + df_free_space
else:
# The free space in this table is the current free space plus
# the additional space that can be gathered by using all available