Quote:
Originally posted by noober
Hey all. I have a script that runs on my aix box that checks lots of stuff including whether or not other servers in my shop are alive. I would like to somehow execute something from this script (on the aix machine) that would reach out to my sql server and at least verify that the database is up...currently I have just scripted some basic ping tests to the server that hosts my SQL Server database.
Anyone help with this scripting?
|
perl -MIO:

ocket::INET -e 'IO:

ocket::INET->new("127.0.0.1:80") || exit 1'
This will return a failure code if it can't connect to the webserver on the local host. You could put it in an "if" statement, such as:
if perl ...
then #success
else #failure
fi
I forget what the MS SQL Server port number is, but you can look that up easily enough.