Need C program for monitoring a processes that are running in different nodes

Hey,
I am doing a high availability project. I need coding(socket programming using C) to monitor processes that are running in different nodes with in a network cluster.At last if u could give me a program in C to monitor the process(whether it is running or failed),it would be very heplfull.Plz help me.

thanx for ur valuable support.

Can you not create a simple cron script that emails you when the process is down. That is what most people do. Something like this run every X minutes:

ps -ef | grep 'myprocess' | grep -v 'grep' | read result
if [[ -z "$result" ]] ; then
     echo "myprocess is down `date`" | mailx -s 'myprocess is down' me@my.com
fi

hey dude...
thanx for ur valuable response...