The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 07: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 05:19 PM
How to create a dummy process of a process already running? shambhu UNIX for Advanced & Expert Users 3 08-31-2007 10: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 03:58 PM
How to monitor if a process is running Pedro Tavares High Level Programming 3 11-14-2001 03:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-29-2005
pradeepmacha pradeepmacha is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 20
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.
  #2 (permalink)  
Old 03-30-2005
pradeepmacha pradeepmacha is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 20
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.
  #3 (permalink)  
Old 03-30-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
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.
  #4 (permalink)  
Old 03-30-2005
pradeepmacha pradeepmacha is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 20
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.
  #5 (permalink)  
Old 03-30-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
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
  #6 (permalink)  
Old 04-25-2005
pradeepmacha pradeepmacha is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 20
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
  #7 (permalink)  
Old 04-25-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0