Module: check_mk
Branch: master
Commit: bf89a1118b6458d1a852a9c8ccdb682363ab8ff0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf89a1118b6458…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Sep 30 17:45:57 2016 +0200
Updated bug entries #2503
---
.bugs/2503 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2503 b/.bugs/2503
new file mode 100644
index 0000000..af9c9cd
--- /dev/null
+++ b/.bugs/2503
@@ -0,0 +1,9 @@
+Title: If you change a ruleset that is just used by the agent bakery, no pending change should be created
+Component: wato
+State: open
+Date: 2016-09-30 17:45:04
+Targetversion: 1.2.8
+Class: nastiness
+
+For example create a rule for restricting the agent access to certain
+IP addresses. This does but should not create a pending change in WATO.
Module: check_mk
Branch: master
Commit: 762ba465b49f34df9d49e5332523fbfda868ce12
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=762ba465b49f34…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Sep 30 15:34:07 2016 +0200
3907 FIX oracle_tablespaces: simplyfied free space calculation depending on version
Oracle version greater than 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!
Oracle version lower than 11:
The free space in this table is the current free space plus
the additional space that can be gathered by using all available
remaining increment
---
.werks/3907 | 18 ++++++++++++++++++
ChangeLog | 1 +
agents/plugins/mk_oracle | 7 +++++--
checks/oracle_tablespaces | 31 ++++++++++++++++++++++---------
4 files changed, 46 insertions(+), 11 deletions(-)
diff --git a/.werks/3907 b/.werks/3907
new file mode 100644
index 0000000..2cb14a3
--- /dev/null
+++ b/.werks/3907
@@ -0,0 +1,18 @@
+Title: oracle_tablespaces: simplyfied free space calculation depending on version
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i2
+Date: 1475242264
+
+Oracle version greater than 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!
+
+Oracle version lower than 11:
+The free space in this table is the current free space plus
+the additional space that can be gathered by using all available
+remaining increment
+
diff --git a/ChangeLog b/ChangeLog
index c73f3ed..7f25a5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
Checks & Agents:
* 3894 FIX: mkeventd_status: Fixed bug in case Event Console is not running
+ * 3907 FIX: oracle_tablespaces: simplyfied free space calculation depending on version...
WATO:
* 3915 User access times: New icon when never logged in; New column "last seen"
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index 040e9e7..f873d02 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -183,10 +183,12 @@ sql_tablespaces()
||'|'|| ONLINE_STATUS ||'|'|| BLOCK_SIZE
||'|'|| decode(tstatus,'READ ONLY', 'READONLY', tstatus) || '|' || free_blocks
||'|'|| contents
+ ||'|'|| iversion
from v\$database d , v\$instance i, (
select f.file_name, f.tablespace_name, f.status fstatus, f.AUTOEXTENSIBLE,
f.blocks, f.maxblocks, f.USER_BLOCKS, f.INCREMENT_BY,
- f.ONLINE_STATUS, t.BLOCK_SIZE, t.status tstatus, nvl(sum(fs.blocks),0) free_blocks, t.contents
+ f.ONLINE_STATUS, t.BLOCK_SIZE, t.status tstatus, nvl(sum(fs.blocks),0) free_blocks, t.contents,
+ (select version from v\$instance) iversion
from dba_data_files f, dba_tablespaces t, dba_free_space fs
where f.tablespace_name = t.tablespace_name
and f.file_id = fs.file_id(+)
@@ -196,7 +198,8 @@ sql_tablespaces()
UNION
select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE,
f.blocks, f.maxblocks, f.USER_BLOCKS, f.INCREMENT_BY, 'TEMP',
- t.BLOCK_SIZE, t.status, sum(sh.blocks_free) free_blocks, 'TEMPORARY'
+ t.BLOCK_SIZE, t.status, sum(sh.blocks_free) free_blocks, 'TEMPORARY',
+ (select version from v\$instance) version
from v\$thread th, dba_temp_files f, dba_tablespaces t, v\$temp_space_header sh
WHERE f.tablespace_name = t.tablespace_name and f.file_id = sh.file_id
GROUP BY th.instance, f.file_name, f.tablespace_name, f.status,
diff --git a/checks/oracle_tablespaces b/checks/oracle_tablespaces
index e202c79..7e799cc 100644
--- a/checks/oracle_tablespaces
+++ b/checks/oracle_tablespaces
@@ -100,20 +100,25 @@ def parse_oracle_tablespaces(info):
sid = line[0]
error_sids[sid] = err
- if len(line) not in (13, 14):
+ if len(line) not in (13, 14, 15):
continue
sid, datafile_name, ts_name, datafile_status, autoextensible, \
filesize_blocks, max_filesize_blocks, used_blocks, increment_size, \
file_online_status, block_size, ts_status, free_space = line[:13]
+ db_version = 0
+
if len(line) == 14:
ts_type = line[13]
else:
# old behaivor is all Tablespaces are treated as PERMANENT
ts_type = 'PERMANENT'
- tablespaces.setdefault((node_name, sid, ts_name), [])
+ if len(line) == 15:
+ db_version = line[14].split('.')[0]
+
+ tablespaces.setdefault((node_name, sid, ts_name, db_version), [])
this_tablespace = {
"name" : datafile_name,
@@ -145,13 +150,13 @@ def parse_oracle_tablespaces(info):
"increment_size" : None,
})
- tablespaces[(node_name, sid, ts_name)].append(this_tablespace)
+ tablespaces[(node_name, sid, ts_name, db_version)].append(this_tablespace)
# Now join this into one dictionary. If there are more than
# one nodes per tablespace, then we select that node with the
# most data files
result = {}
- for (node_name, sid, ts_name), datafiles in tablespaces.items():
+ for (node_name, sid, ts_name, db_version), datafiles in tablespaces.items():
ts_key = (sid, ts_name)
# Use data from this node, if it is the first/only, or if it
# has more data files than a previous one
@@ -159,6 +164,7 @@ def parse_oracle_tablespaces(info):
len(result[ts_key]["datafiles"]) < len(datafiles):
result[ts_key] = {
+ "db_version" : db_version,
"datafiles" : datafiles,
"type" : datafiles[0]["ts_type"],
"status" : datafiles[0]["ts_status"],
@@ -208,6 +214,7 @@ def check_oracle_tablespaces(item, params, parsed):
ts_type = tablespace["type"]
ts_status = tablespace["status"]
+ db_version = tablespace["db_version"]
num_files = 0
num_avail = 0
num_extensible = 0
@@ -267,10 +274,15 @@ def check_oracle_tablespaces(item, params, parsed):
num_increments += incs
increment_size += incsize * incs
- # The free space in this table is the current free space plus
- # the additional space that can be gathered by using all available
- # remaining increments
- free_space += increment_size + df_free_space
+ 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
+ else:
+ # The free space in this table is the current free space plus
+ # the additional space that can be gathered by using all available
+ # remaining increments
+ free_space += increment_size + df_free_space
# not autoextensible: take current size as maximum
else:
@@ -283,7 +295,8 @@ def check_oracle_tablespaces(item, params, parsed):
get_bytes_human_readable(used_size),
get_bytes_human_readable(max_size))]
- if num_extensible > 0:
+ if num_extensible > 0 and db_version <= 10:
+ # only display the number of remaining extents in Databases <= 10g
infotexts.append("%d increments (%s)" % \
(num_increments, get_bytes_human_readable(increment_size)))
Module: check_mk
Branch: master
Commit: 970771890a1aea5f7a778b5b4f1d8d752c661167
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=970771890a1aea…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Sep 30 15:21:41 2016 +0200
removed some comments
---
inventory/oracle_dataguard_stats | 13 -------------
inventory/oracle_instance | 13 -------------
inventory/oracle_performance | 12 ------------
inventory/oracle_recovery_area | 13 -------------
4 files changed, 51 deletions(-)
diff --git a/inventory/oracle_dataguard_stats b/inventory/oracle_dataguard_stats
index 2af757e..5c86920 100644
--- a/inventory/oracle_dataguard_stats
+++ b/inventory/oracle_dataguard_stats
@@ -24,19 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# example output
-# OTHER Database (SID) *
-# OTHER Oracle Version *
-# OTHER Database Creation Time 'SELECT CREATED' or 'SELECT MIN(created) FROM dba_objects'
-# DB Startup Time 'SELECT to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') "DB Startup Time" FROM sys.v_$instance;'
-# OTHER DB Log Mode *
-# OTHER DB Open Mode *
-# OTHER DB Logins *
-# DONE Dataguard State -
-# OTHER Flashback 'SELECT flashback_on FROM v$database;'
-# SGA (System Global Area) 'SELECT * FROM V$SGA;' or 'select * from V$SGAINFO;'
-# Temp File Size 'SELECT * FROM V$TEMPFILE'
-
def inv_oracle_dataguard_stats(info):
node = inv_tree_list("software.applications.oracle.dataguard_stats:")
diff --git a/inventory/oracle_instance b/inventory/oracle_instance
index 5753bbc..66b8fe8 100644
--- a/inventory/oracle_instance
+++ b/inventory/oracle_instance
@@ -24,19 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# example output
-# DONE Database (SID) *
-# DONE Oracle Version *
-# DONE Database Creation Time -
-# DONE DB Startup Time -
-# DONE DB Log Mode *
-# DONE DB Open Mode *
-# DONE DB Logins *
-# OTHER Dataguard State -
-# OTHER Flashback -
-# SGA (System Global Area) -
-# Temp File Size -
-
# <<<oracle_instance:sep(124)>>>
# XE|11.2.0.2.0|OPEN|ALLOWED|STOPPED|3524|2752243048|NOARCHIVELOG|PRIMARY|NO|XE|080220151025
diff --git a/inventory/oracle_performance b/inventory/oracle_performance
index 1e6f222..b4ac37d 100644
--- a/inventory/oracle_performance
+++ b/inventory/oracle_performance
@@ -24,18 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# example output
-# OTHER Database (SID) *
-# OTHER Oracle Version *
-# OTHER Database Creation Time -
-# OTHER DB Startup Time -
-# OTHER DB Log Mode *
-# OTHER DB Open Mode *
-# OTHER DB Logins *
-# OTHER Dataguard State -
-# OTHER Flashback -
-# DONE SGA (System Global Area) -
-# Temp File Size -
# <<<oracle_performance:sep(124)>>>
# XE|SGA_info|Maximum SGA Size|367439872
diff --git a/inventory/oracle_recovery_area b/inventory/oracle_recovery_area
index f6ddea5..ff670cd 100644
--- a/inventory/oracle_recovery_area
+++ b/inventory/oracle_recovery_area
@@ -24,19 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# example output
-# OHTER Database (SID) *
-# OHTER Oracle Version *
-# OHTER Database Creation Time -
-# OHTER DB Startup Time -
-# OHTER DB Log Mode *
-# OHTER DB Open Mode *
-# OHTER DB Logins *
-# OTHER Dataguard State -
-# DONE Flashback -
-# SGA (System Global Area) -
-# Temp File Size -
-
def inv_oracle_recovery_area(info):
node = inv_tree_list("software.applications.oracle.recovery_area:")