Module: check_mk
Branch: master
Commit: c77facf10fa871af9c8104ac7308c5b616667704
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c77facf10fa871…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Jun 16 15:50:57 2017 +0200
Updated werks 4868, 4785 for other mk_oracle plugins
Change-Id: I79581af0583340c18a016cc4852cce4c42753ec4
---
agents/plugins/mk_oracle.aix | 43 +++++++++++++++++++++++++++++++++---
agents/windows/plugins/mk_oracle.ps1 | 39 +++++++++++++++++++++++++++++++-
2 files changed, 78 insertions(+), 4 deletions(-)
diff --git a/agents/plugins/mk_oracle.aix b/agents/plugins/mk_oracle.aix
index 27f5bb4..74ebdc2 100755
--- a/agents/plugins/mk_oracle.aix
+++ b/agents/plugins/mk_oracle.aix
@@ -68,12 +68,12 @@ fi
# '----------------------------------------------------------------------'
# Sections that run fast and do no caching
-SYNC_SECTIONS="instance sessions logswitches undostat recovery_area processes
recovery_status longactivesessions dataguard_stats performance"
+SYNC_SECTIONS="instance sessions logswitches undostat recovery_area processes
recovery_status longactivesessions dataguard_stats performance locks"
# Sections that are run in the background and at a larger interval.
# Note: sections not listed in SYNC_SECTIONS or ASYNC_SECTIONS will not be
# executed at all!
-ASYNC_SECTIONS="tablespaces rman jobs ts_quotas resumable locks"
+ASYNC_SECTIONS="tablespaces rman jobs ts_quotas resumable"
# Sections that are run in the background and at a larger interval.
# Note: _ASM_ sections are only executed when SID starts with '+'
@@ -192,7 +192,8 @@ sql_tablespaces()
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,
f.autoextensible, f.blocks, f.maxblocks, f.user_blocks,
f.increment_by,
- 'TEMP', t.block_size, t.status);
+ 'TEMP', t.block_size, t.status)
+ where d.database_role = 'PRIMARY';
"
elif [ "$AT_LEAST_ORACLE_92" = 'yes' ] ; then
@@ -560,6 +561,42 @@ sql_logswitches()
sql_locks()
{
+ if [ "$AT_LEAST_ORACLE_102" = 'yes' ] ; then
+ echo 'prompt <<<oracle_locks:sep(124)>>>'
+ echo "select upper(i.instance_name)
+ || '|' || b.sid
+ || '|' || b.serial#
+ || '|' || b.machine
+ || '|' || b.program
+ || '|' || b.process
+ || '|' || b.osuser
+ || '|' || b.username
+ || '|' || b.SECONDS_IN_WAIT
+ || '|' || b.BLOCKING_SESSION_STATUS
+ || '|' || bs.inst_id
+ || '|' || bs.sid
+ || '|' || bs.serial#
+ || '|' || bs.machine
+ || '|' || bs.program
+ || '|' || bs.process
+ || '|' || bs.osuser
+ || '|' || bs.username
+ from v\$session b
+ join v\$instance i on 1=1
+ join gv\$session bs on bs.inst_id = b.BLOCKING_INSTANCE
+ and bs.sid = b.BLOCKING_SESSION
+ where b.BLOCKING_SESSION is not null
+;
+ select upper(i.instance_name)
+ || '|||||||||||||||||'
+ from v\$instance i
+;
+ "
+ fi
+}
+
+sql_locks_old()
+{
if [ "$AT_LEAST_ORACLE_101" = 'yes' ] ; then
echo 'prompt <<<oracle_locks:sep(124)>>>'
echo "SET SERVEROUTPUT ON feedback off
diff --git a/agents/windows/plugins/mk_oracle.ps1 b/agents/windows/plugins/mk_oracle.ps1
index da6ea5d..c983b34 100644
--- a/agents/windows/plugins/mk_oracle.ps1
+++ b/agents/windows/plugins/mk_oracle.ps1
@@ -635,7 +635,7 @@ Function sql_tablespaces {
GROUP BY th.instance, 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)
- ;
+ where d.database_role = 'PRIMARY';
'@
@@ -1114,6 +1114,43 @@ echo $query_logswitches
# SQL for database lock information
################################################################################
Function sql_locks {
+ if ($DBVERSION -gt 101000)
+ {
+ $query_locks = @'
+ select upper(i.instance_name)
+ || '|' || b.sid
+ || '|' || b.serial#
+ || '|' || b.machine
+ || '|' || b.program
+ || '|' || b.process
+ || '|' || b.osuser
+ || '|' || b.username
+ || '|' || b.SECONDS_IN_WAIT
+ || '|' || b.BLOCKING_SESSION_STATUS
+ || '|' || bs.inst_id
+ || '|' || bs.sid
+ || '|' || bs.serial#
+ || '|' || bs.machine
+ || '|' || bs.program
+ || '|' || bs.process
+ || '|' || bs.osuser
+ || '|' || bs.username
+ from v\$session b
+ join v\$instance i on 1=1
+ join gv\$session bs on bs.inst_id = b.BLOCKING_INSTANCE
+ and bs.sid = b.BLOCKING_SESSION
+ where b.BLOCKING_SESSION is not null
+ ;
+ select upper(i.instance_name)
+ || '|||||||||||||||||'
+ from v\$instance i
+ ;
+ '@
+ echo $query_locks
+ }
+}
+
+Function sql_locks_old {
if ($DBVERSION -gt 101000)
{
$query_locks = @'