The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell Programming and Scripting 1 02-15-2008 03:10 PM
how to check if a process is running in a server from shell script. debu UNIX for Advanced & Expert Users 2 01-24-2008 01:19 PM
How to create a dummy process of a process already running? shambhu UNIX for Advanced & Expert Users 3 08-31-2007 07:22 AM
how to get the list of process running in the server from the local machin n unix ? guhas Shell Programming and Scripting 3 10-04-2005 12:58 PM
How to monitor if a process is running Pedro Tavares High Level Programming 3 11-14-2001 11:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-29-2005
Registered User
 

Join Date: Mar 2005
Posts: 20
Stumble this Post!
Question process running on server and mail

Hello all,
I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted.

Thanks in advance

Regards,
pradeep kulkarni.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-29-2005
Registered User
 

Join Date: Mar 2005
Posts: 20
Stumble this Post!
Red face script to monitor process running on server and posting a mail if any process is dead

Hello all,
can any body help me with a script that will check every day for process running on UNIX server and Post a mail if any of the process has aborted or stoped. It is really urgent and i 'm new to unix.
Plz some one help me on this at the earliest.

Thanks in advance,
Regards,
Pradeep Kulkarni.
Reply With Quote
  #3 (permalink)  
Old 03-30-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Stumble this Post!
First, read the rules - no double posting or bumping post to get an answer.

Next, these forums are meant to help those that help themselves. Meaning you start writing the script and when you get to a problem, post it and we assist in solving your problem. Just look at how you normally would solve this problem from the command line and put it into a file which you then set to executable.
Reply With Quote
  #4 (permalink)  
Old 03-30-2005
Registered User
 

Join Date: Mar 2005
Posts: 20
Stumble this Post!
hello,
i have posted the mail to make my problem clear. i know how to check it through command line using ps command. but i dont know how i get the status of the process and after that when i redirect the output to a file how do i filter it for the aborted/ stoped processes and send a mail. i have tried writing script but i did not work that why i have ask for help. thanks for you suggestion...i would be thankful if any onne could help me with this script the giving advices.


regards,
Pradeep Kulkarni.
Reply With Quote
  #5 (permalink)  
Old 03-30-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Stumble this Post!
I don't see anything attached.

Try a copy/paste into the window where you type this message.
Use code with square brackets
Code:
#this is my script
exit
Reply With Quote
  #6 (permalink)  
Old 04-25-2005
Registered User
 

Join Date: Mar 2005
Posts: 20
Stumble this Post!
server process monitoring via mail

hi guys,
i'm back with a small problem.
i have now written a script that will grep for a process and will notify me if not running.
[#!/bin/ksh
pid=""
pid='ps -ef | grep "<process string>" | awk ' {print $2}''
echo $pid
if [ "$pid"="" ]
then
echo "process not running"
rsh <mail server> mailx -s "<etc etc process not running>" <mail.id>
else
echo service is ok
pid=""
fi
]
now i'm have a problem in the mailing section.
can any one tell me how i can redirect the output to a file and send it via mail if the process i'm greping is not runnning. i tried the above syntax and failed.

And one more help how can i find the parent process that aare running so that i can make a list of those important process.

kindly some one look into this and reply at earliest.

Regards,
Pradeep Kulkarni
Reply With Quote
  #7 (permalink)  
Old 04-25-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Stumble this Post!
Instead of
rsh <mail server> mailx -s "<etc etc process not running>" <mail.id>
try
mailx -s "<etc etc process not running>" yourID@yourdomain.xxx < /dev/null

Change yourID and yourdomain.xxx to your userid and domain name.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:03 AM.


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

Content Relevant URLs by vBSEO 3.2.0