Module: check_mk
Branch: master
Commit: d904734a47dec760abbe91fb7062ddb47bb9305a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d904734a47dec7…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed May 10 09:24:17 2017 +0200
4648 FIX mk_oracle: Fixed logswitches SQL statement for ORACLE RAC case
Change-Id: I76a8ddbcf10d5ab2c06d6b19e4c55bb9ef38ac88
---
.werks/4648 | 13 +++++++++++++
agents/plugins/mk_oracle | 5 +++--
agents/plugins/mk_oracle.aix | 5 +++--
agents/windows/plugins/mk_oracle.ps1 | 6 +++---
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/.werks/4648 b/.werks/4648
new file mode 100644
index 0000000..03d22dc
--- /dev/null
+++ b/.werks/4648
@@ -0,0 +1,13 @@
+Title: mk_oracle: Fixed logswitches SQL statement for ORACLE RAC case
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1494398362
+
+In case of at least two instances the overall sum of logswitches
+was reported for each instance. Now the related amounts of logswitches
+of each instance are returned.
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index 1cc30ae..028b6bc 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -568,8 +568,9 @@ sql_logswitches()
|| ' ' || logswitches
from v\$instance i ,
(select count(1) logswitches
- from v\$loghist
- where first_time > sysdate - 1/24
+ from v\$loghist h , v\$instance i
+ where h.first_time > sysdate - 1/24
+ and h.thread# = i.instance_number
);
"
}
diff --git a/agents/plugins/mk_oracle.aix b/agents/plugins/mk_oracle.aix
index 9d30acb..7ad2bff 100755
--- a/agents/plugins/mk_oracle.aix
+++ b/agents/plugins/mk_oracle.aix
@@ -551,8 +551,9 @@ sql_logswitches()
|| ' ' || logswitches
from v\$instance i ,
(select count(1) logswitches
- from v\$loghist
- where first_time > sysdate - 1/24
+ from v\$loghist h , v\$instance i
+ where h.first_time > sysdate - 1/24
+ and h.thread# = i.instance_number
);
"
}
diff --git a/agents/windows/plugins/mk_oracle.ps1 b/agents/windows/plugins/mk_oracle.ps1
index 8a727a7..da6ea5d 100644
--- a/agents/windows/plugins/mk_oracle.ps1
+++ b/agents/windows/plugins/mk_oracle.ps1
@@ -1098,9 +1098,9 @@ select upper(i.instance_name)
|| '|' || logswitches
from v$instance i ,
(select count(1) logswitches
- from v$loghist
- where first_time > sysdate - 1/24
- )
+ from v\$loghist h , v\$instance i
+ where h.first_time > sysdate - 1/24
+ and h.thread# = i.instance_number)
;
'@