Checking for processes in Linux

I want to check processes on my Linux server

Normally we do a ps-ef|grep "search code"

Now we want to check for certain processes which are up and running and we want to get an email, whenever the processes we are checking goes down?

How can i implement this?

this might help

unix - Bash script to monitor process and sendmail if failed - Stack Overflow