aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-03-17 22:24:30 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-03-17 22:24:30 +0000
commitb4bb59cd9bd16e3f3c1df907b8802e7e476d2ec8 (patch)
tree3ee4e6861cd51a8ebd988f45de20862db192a773
parent704b1e2dca00007d7310c129e29e708107e12f1d (diff)
downloadmonitoring-plugins-b4bb59cd9bd16e3f3c1df907b8802e7e476d2ec8.tar.gz
Allow default Oracle home from oratab (reported by Walbert Oberngruber)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@428 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-xplugins-scripts/check_oracle.sh35
1 files changed, 16 insertions, 19 deletions
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 998899b9..3064db90 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -18,12 +18,6 @@
# I have the script checking for the Oracle PMON process and
# the sgadefORACLE_SID.dbf file.
#
-#
-# If you have any problems check that you have the $ORACLE_HOME
-# enviroment variable set, have $ORACLE_HOME/bin in your PATH, and
-# dont forget about your tnsnames.ora file. when checking Local
-# Database status your ORACLE_SID is case sensitive.
-#
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
@@ -45,17 +39,17 @@ print_usage() {
}
print_help() {
- print_revision $PROGNAME $REVISION
- echo ""
- print_usage
- echo ""
- echo "Check remote or local TNS status and check local Database status"
- echo ""
+ print_revision $PROGNAME $REVISION
+ echo ""
+ print_usage
+ echo ""
+ echo "Check remote or local TNS status and check local Database status"
+ echo ""
echo "--tns=SID/IP Address"
echo " Check remote TNS server"
echo "--db=SID"
echo " Check local database (search /bin/ps for PMON process and check"
- echo " filesystem for sgadefORACLE_SID.dbf"
+ echo " filesystem for sgadefORACLE_SID.dbf"
echo "--login=SID"
echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password"
echo "--cache"
@@ -69,17 +63,20 @@ print_help() {
echo "--oranames=Hostname"
echo " Check remote Oracle Names server"
echo "--help"
- echo " Print this help screen"
+ echo " Print this help screen"
echo "--version"
- echo " Print version and license information"
- echo ""
+ echo " Print version and license information"
+ 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 "variable is set, that ORACLE_HOME/bin is in your PATH, and the"
echo "tnsnames.ora file is locatable and is properly configured."
echo ""
echo "When checking Local Database status your ORACLE_SID is case sensitive."
echo ""
- support
+ echo "If you want to use a default Oracle home, add in your oratab file:"
+ echo "*:/opt/app/oracle/product/7.3.4:N"
+ echo ""
+ support
}
case "$1" in
@@ -123,7 +120,7 @@ if [ -z "$ORACLE_HOME" ] ; then
ORACLE_HOME=`IFS=:
while read SID ORACLE_HOME junk;
do
- if [ "$SID" = "$2" ] ; then
+ if [ "$SID" = "$2" -o "$SID" = "*" ] ; then
echo $ORACLE_HOME;
exit;
fi;