Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5183cb97850ab34770e23cc9d644e0d0 > files > 17

watchdog-5.6-2mdv2010.0.i586.rpm

#!/bin/sh

#
# check if ORACLE database instance is still reacting to ping requests
#

#
# name of the instance (must be defined in tnsnames.ora)
#
DATABASE=$1

#
# check the state:
# tnsping returns 0 on success, otherise the return value is 1
#
tnsping $DATABASE > /dev/null 2>&1
result=$?

if [ $result -ne 0 ]
then
#
#	obviously there is no system error code for this
#	so we have to create our own (system codes are > 0): -2.
#	note that -1 means reboot
#
	result=-2
fi

exit $result