Your script could be something as simple as it executes a ps, counts how many times your program appears, then runs a command if it does not appear in the ps listing. I would do it like this:
All you need to do is copy and paste the following lines into a blank file and run it on cron as often as you want.
#!/usr/bin/ksh
# Written by: Bryan Pinos for a memeber of Tek Tips
# Date: March 26, 2003
# This program should be named entirely different than what
# you are searching for since it will be running in memory
# and could affect what it finds running in memorry.
# Place some sort of criteria in the variable pidname that
# can uniquely identify the pid command you want monitored.
pidname="httpd"
numexists=`ps -ef | grep -c $pidname`
# We must seacrh for greater than one since the grep command
# will contain what we are searching for.
if [ $numexists -gt 1 ]; then
echo "ALL IS WELL WITH: $pidname"
else
echo "*******Program needs restarted!!!********"
echo "Executing command"
# Place command to start your program here
fi