1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
--- check_oracle 2010-10-07 17:11:31.000000000 +0200
+++ check_oracle_easylogin 2011-07-22 15:23:13.000000000 +0200
@@ -8,7 +8,7 @@
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
-REVISION="1.4.15"
+REVISION="1.4.15-easylogin"
. $PROGPATH/utils.sh
@@ -54,6 +54,8 @@
echo "--version"
echo " Print version and license information"
echo ""
+ echo "If <USER> and <PASS> are left blank, ie. \"\", \`sqlplus -s / as sysdba\` is tried instead."
+ echo ""
echo "If the plugin doesn't work, check that the ORACLE_HOME environment"
echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the"
echo "tnsnames.ora file is locatable and is properly configured."
@@ -192,7 +194,9 @@
echo "UNKNOWN - Warning level is less then Crit"
exit $STATE_UNKNOWN
fi
- result=`sqlplus -s ${3}/${4}@${2} << EOF
+ cmdsqlplus="sqlplus -s / as sysdba"
+ [ "$3" != "" ] && [ "$4" != "" ] && cmdsqlplus="sqlplus -s ${3}/${4}@${2}"
+ result=`$cmdsqlplus << EOF
set pagesize 0
set numf '9999999.99'
select (1-(pr.value/(dbg.value+cg.value)))*100
@@ -243,7 +247,9 @@
echo "UNKNOWN - Warning level is more then Crit"
exit $STATE_UNKNOWN
fi
- result=`sqlplus -s ${3}/${4}@${2} << EOF
+ cmdsqlplus="sqlplus -s / as sysdba"
+ [ "$3" != "" ] && [ "$4" != "" ] && cmdsqlplus="sqlplus -s ${3}/${4}@${2}"
+ result=`$cmdsqlplus << EOF
set pagesize 0
set numf '9999999.99'
select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
|