Module: check_mk
Branch: master
Commit: e5438421241b2544a4ed33618fbf6f72a1621aa4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e5438421241b25…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 5 10:01:28 2012 +0100
Fix various problems in mk_oracle agent plugin
---
ChangeLog | 2 ++
agents/plugins/mk_oracle | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 27c8b92..02a6667 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -74,6 +74,8 @@
to Stefan Kärst)
* FIX: megaraid_bbu: fix problem with alternative agent output
(thanks to Daniel Tuecks)
+ * mk_oracle: fix quoting problem, replace sessions with version,
+ use /bin/bash instead of /bin/sh
Multisite:
* Added several missing localization strings
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index 77b01ba..852c417 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
@@ -102,7 +102,7 @@ for SID in $SIDS; do
{
# Only execute checks when not filtered
if [ "$EXCLUDE" = "${EXCLUDE/oracle_version/}" ]; then
- echo '<<<oracle_sessions>>>'
+ echo '<<<oracle_version>>>'
echo \"select banner from v\\\$version where banner like
'Oracle%';\" | sqlplus \"$SID\"
fi
@@ -133,7 +133,7 @@ for SID in $SIDS; do
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
- from v\$thread th, dba_temp_files f, dba_tablespaces t,
v\$temp_space_header sh
+ 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,
f.autoextensible, f.blocks, f.maxblocks, f.user_blocks, f.increment_by,