summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 455e7c1)
raw | patch | inline | side by side (parent: 455e7c1)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 29 Jan 2003 05:10:49 +0000 (05:10 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 29 Jan 2003 05:10:49 +0000 (05:10 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@263 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_oracle.sh | patch | blob | history |
index d2a84fe7cc4d4d6c083a50f81a2d5df8fc442f5c..7e2f6f99f7e2969e301c1a9076f5b76f9e41e282 100755 (executable)
echo "Usage:"
echo " $PROGNAME --tns <Oracle Sid or Hostname/IP address>"
echo " $PROGNAME --db <ORACLE_SID>"
+ echo " $PROGNAME --login <ORACLE_SID>"
echo " $PROGNAME --oranames <Hostname>"
echo " $PROGNAME --help"
echo " $PROGNAME --version"
echo "--db=SID"
echo " Check local database (search /bin/ps for PMON process and check"
echo " filesystem for sgadefORACLE_SID.dbf"
+ echo "--login=SID"
+ echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password"
echo "--oranames=Hostname"
echo " Check remote Oracle Names server"
echo "--help"
;;
esac
+# Information options
+case "$cmd" in
+--help)
+ print_help
+ exit $STATE_OK
+ ;;
+-h)
+ print_help
+ exit $STATE_OK
+ ;;
+--version)
+ print_revision $PLUGIN $REVISION
+ exit $STATE_OK
+ ;;
+-V)
+ print_revision $PLUGIN $REVISION
+ exit $STATE_OK
+ ;;
+esac
+
# Hunt down a reasonable ORACLE_HOME
if [ -z "$ORACLE_HOME" ] ; then
# Adjust to taste
exit $STATE_CRITICAL
fi
;;
---help)
- print_help
- exit $STATE_OK
- ;;
--h)
- print_help
- exit $STATE_OK
- ;;
---version)
- print_revision $PLUGIN $REVISION
- exit $STATE_OK
- ;;
--V)
- print_revision $PLUGIN $REVISION
- exit $STATE_OK
+--login)
+ loginchk=`sqlplus dummy/user@$2 < /dev/null`
+ loginchk2=` echo $loginchk | grep -c ORA-01017`
+ if [ ${loginchk2} -eq 1 ] ; then
+ echo "OK - dummy login connected"
+ exit $STATE_OK
+ else
+ loginchk3=` echo "$loginchk" | grep "ORA-" | head -1`
+ echo "CRITICAL - $loginchk3"
+ exit $STATE_CRITICAL
+ fi
;;
*)
print_usage