The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script to monitor process running on server and posting a mail if any process is dead pradeepmacha Shell Programming and Scripting 12 10-17-2008 12:08 AM
check process running rose1207 Shell Programming and Scripting 4 12-27-2007 10:23 PM
Script to check running processes on remote server. amitsayshii Shell Programming and Scripting 5 10-06-2006 12:43 AM
How to check for specific process running through shell agp Shell Programming and Scripting 3 03-25-2006 03:24 AM
script to check for a particular process and alert if its not running goks Shell Programming and Scripting 1 12-09-2005 02:11 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-23-2008
Registered User
 

Join Date: May 2007
Posts: 10
how to check if a process is running in a server from shell script.

I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process???
Reply With Quote
Forum Sponsor
  #2  
Old 01-23-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
debu,

did you try the search option of the forum ?

Very sure, there are many threads discussing the same in various colors.

Please use the search
Reply With Quote
  #3  
Old 01-24-2008
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Quote:
Originally Posted by debu View Post
I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process???
Hey,

YOu can check the process state table with grep on the name of the process you wished to check.

ps -ef | grep "debu" > maillist.txt

if [ -s maillist.txt ] ; then
echo "Process is Running "
else
cat maillist.txt | mailx -s "ALARM !!" abc@aol.com
fi


Hope this'll work for you.
Thanks
Varun
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0