How to check whether server is up or down by monitoring PID?

we have a server, which becomes down at times and we dont get any notification mail.

Can we monitor PID for that server run and create a script to send notification to a mail id?

I have URL for the server, which I can use.
Please let me know if more information is required from my end to clarify the requirment.

Please provide easy to apply solution..

thanks in advance!!

In my experience just because the PID exists, it doesn't mean that the server is up and running.

If it is a web server that you are monitoring, try using wget periodically. You can then grep the output to check for expected html content.

For other types of servers, something similar can be done.

Peace

if its not a webserver, if its just a server running on unix. u can easily use

#!/usr/bin/ksh

SERV_ERR=0
ps -eaf | grep "ashasas" > log.txt
if [ $? ]
then
       SERV_ERR=1
fi

if [[ $SERV_ERR -gt 0 ]]
then
echo "we got problems"
mailx "to ur mail"
fi

see if this solves the purpose