Module: check_mk
Branch: master
Commit: 5dacac62b0471b47f8d6d22137cc897144c1765c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5dacac62b0471b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 31 16:40:53 2012 +0100
Made mk_oracle.bat a little easier to configure
---
agents/windows/plugins/mk_oracle.bat | 41 +++++++++++++++++++---------------
1 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/agents/windows/plugins/mk_oracle.bat b/agents/windows/plugins/mk_oracle.bat
index 8ce2262..da8340d 100644
--- a/agents/windows/plugins/mk_oracle.bat
+++ b/agents/windows/plugins/mk_oracle.bat
@@ -1,4 +1,24 @@
@echo off
+
+REM ; If you not run this plugin with the environment variable ORACLE_SID set,
+REM ; you can uncomment (Remove the "REM " prefix) the line below to
+REM ; use e.g. "localhost" as oracle sid.
+REM SET ORACLE_SID=localhost
+
+REM ; If you like to use a special auth parameter please change the line below
+SET AUTH=/ as sysdba
+
+echo ^<^<^<oracle_version^>^>^>
+(echo.|set /p x=%ORACLE_SID%)
+(
+echo set cmdsep on
+echo set cmdsep '"'; --"
+echo "set pages 0"
+echo "set feedback off"
+echo "set head off"
+echo "select * from v$version;"
+) | sqlplus -S %AUTH%
+
echo ^<^<^<oracle_sessions^>^>^>
(echo.|set /p x=%ORACLE_SID%)
(
@@ -8,8 +28,7 @@ echo "set pages 0"
echo "set feedback off"
echo "set head off"
echo "select count(*) from v$session where status = 'ACTIVE';"
-) | sqlplus -S / as sysdba
-
+) | sqlplus -S %AUTH%
echo ^<^<^<oracle_logswitches^>^>^>
(echo.|set /p x=%ORACLE_SID%)
@@ -20,9 +39,7 @@ echo "set pages 0"
echo "set feedback off"
echo "set head off"
echo "select count(*) from v$loghist where first_time > sysdate - 1/24;"
-) | sqlplus -S / as sysdba
-
-
+) | sqlplus -S %AUTH%
echo ^<^<^<oracle_tablespaces^>^>^>
(
@@ -36,16 +53,4 @@ echo "set head off"
echo "column instance format a10"
echo "column file_name format a100"
echo "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,
decode(sum(fs.blocks), NULL, 0, sum(fs.blocks)) free_blocks 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(+) group by 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 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, 0 from dba_temp_files f, dba_tablespaces t where f.tablespace_name
= t.tablespace_name;"
-) | sqlplus -S / as sysdba
-
-echo ^<^<^<oracle_version^>^>^>
-REM (echo %ORACLE_SID%)
-(echo.|set /p x=%ORACLE_SID% )
-(
-echo set cmdsep on
-echo set cmdsep '"'; --"
-echo "set pages 0"
-echo "set feedback off"
-echo "set head off"
-echo "select * from v$version;"
-) | sqlplus -S / as sysdba
+) | sqlplus -S %AUTH%