Linux Script to check a process is up or not


Staff member
I have a server Application which holds 1500 process id, I need a shell Script which checks for every hour whether the process is up, if not start the process using "dsmc -u xxxx -p <em>*</em>*" if it is not started send a mail to my gmail([email protected]). here is the code how can i send a mail to my gmail account.

   if pidof -s vsftpd = /dev/null; then
      echo 'ftp is stopped'

       sudo /etc/init.d/vsftpd restart
       echo "The FTP server is Down" | mail -s "Ftp Server is Down" [email protected]

I don't get mail to my Gmail Account.
Reference: <a href="" rel="nofollow"></a>