Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if database server is running

Status
Not open for further replies.

holdahl

IS-IT--Management
Apr 4, 2006
213
NO
I want to write a script that check if a sybase ase server is up and running (that you can connect to it)
Trying to do a ps -ef and grep for dataserver will show the process of the server but it seems like this process is displayed before the server is ready for connections.

Any suggestions?



-holdahl
 
You can test it in UNIX script as follows:

isql -U${USERNAME} -P${PASSWORD} -S${SQL_SERVER} -w1000 << ! > ${LOG_FILE}
exit
!
if [[ $? != 0 ]]
then
msg="`date` ${SQL_SERVER} problem. ${SQL_SERVER} on ${HOST} is down or cannot be accessed"
cat ${LOG_FILE}|/usr/bin/mailx -s "${msg}" ${SUPPORT}
}
exit 1
fi

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top