Module: check_mk
Branch: master
Commit: 28d15d6b4349ac5eae5a47ce17c0ecda36c9f4b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=28d15d6b4349ac…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 22 14:43:17 2011 +0100
Linux mk_oracle: Updated tablespace query to use 'used blocks' instead of
'user blocks'
---
ChangeLog | 1 +
agents/plugins/mk_oracle | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 31a3487..e75f9ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@
* windows_update: Added check to monitor windows update states on windows
clients. The check monitors the number of pending updates and checks if
a reboot is needed after updates have been installed.
+ * Linux mk_oracle: Updated tablespace query to use 'used blocks' instead of
'user blocks'
1.1.10:
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index 4f311ea..e6ad4a2 100644
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -66,8 +66,14 @@ echo '<<<oracle_tablespaces>>>'
for SID in $SIDS
do
sqlplus "$SID" <<EOF | sed 's/READ ONLY/READONLY/g'
-select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE, f.blocks, f.maxblocks,
f.USER_BLOCKS, f.INCREMENT_BY, f.ONLINE_STATUS, t.BLOCK_SIZE, t.status from
dba_data_files f, dba_tablespaces t where f.tablespace_name = t.tablespace_name
+select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE, f.blocks, f.maxblocks,
f.blocks - b.free_blocks as used_blocks, f.INCREMENT_BY, f.ONLINE_STATUS, t.BLOCK_SIZE,
t.status
+from dba_data_files f, dba_tablespaces t ,(SELECT file_id, SUM(blocks) free_blocks FROM
dba_free_space b GROUP BY file_id) b
+where f.tablespace_name = t.tablespace_name
+and f.file_id=b.file_id
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 from
dba_temp_files f, dba_tablespaces t where f.tablespace_name = t.tablespace_name;
+select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE, f.blocks, f.maxblocks,
f.blocks - b.free_blocks as used_blocks, f.INCREMENT_BY, 'TEMP', t.BLOCK_SIZE,
t.status
+from dba_temp_files f, dba_tablespaces t ,(SELECT file_id, SUM(blocks) free_blocks FROM
dba_free_space b GROUP BY file_id) b
+where f.tablespace_name = t.tablespace_name
+and f.file_id=b.file_id ;
EOF
done