[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_oracle.sh,1.2,1.3
Ton Voon
tonvoon at users.sourceforge.net
Tue Jan 28 21:11:06 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv5512
Modified Files:
check_oracle.sh
Log Message:
Added dummy login test (650970 - Ton Voon)
Index: check_oracle.sh
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_oracle.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_oracle.sh 6 Jun 2002 04:15:06 -0000 1.2
--- check_oracle.sh 29 Jan 2003 05:10:49 -0000 1.3
***************
*** 37,40 ****
--- 37,41 ----
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"
***************
*** 54,57 ****
--- 55,60 ----
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"
***************
*** 82,85 ****
--- 85,108 ----
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
***************
*** 157,175 ****
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
;;
*)
--- 180,194 ----
fi
;;
! --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
;;
*)
More information about the Commits
mailing list