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
How to check if DHCP is running on HP-UX box? nuGuy HP-UX 2 04-12-2008 09:47 AM
Check backup file size on backup tape ayhanne UNIX for Dummies Questions & Answers 0 10-25-2007 08:41 AM
Check the backup dates on Tape masquerer AIX 0 07-05-2007 06:28 AM
How to check the size of the backup from the tape? sharif UNIX for Advanced & Expert Users 0 06-04-2007 08:06 AM
check that script is not running twice Link_02 Shell Programming and Scripting 2 02-20-2002 04:17 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-29-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
pmon and tnslsnr - how to check when they are back running after a backup

Hi Guys,

problem statement - I wish to come up with a script which sends an email as soon as tnslsnr and pmon process are back online after a backup is complete.

Detailed description - We have a few Solaris servers. A daily backup is taken on all of them. Before a backup is taken, pmon process and tnslsnr are taken down (achieved via a script ). This is done at a fixed time everyday.

Depending on how much time it takes, the pmon and the tnslsnr stay down. Now, I wish to create a script which sends an email telling that the pmon and tnslsnr are back running after the backup.

PS : I can write a script which runs periodically (lets say every 20 minutes) using the ps -ef and checks for the process with something like this :

#!/bin/ksh
pid=""
pid=ps -ef | grep <user> | grep -v grep | 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


But I wish to achieve this without running the script periodically. I was hoping to maybe capture an event somehow/somewhere, as soon as pmon and tnslsnr are back running and use it to write my script.
Is there a file/log that captures when all the processes are down or running? and If yes, is there a way to use that info in generateing a script for my problem above ?

any help or insight into my querry is much appreciated !!!
Reply With Quote
Forum Sponsor
  #2  
Old 01-30-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
You can watch the oracle logs but that's much the same procedure as doing you current polling of the process table.

I'd think tying something into the script that starts the listener after the backup would be simpler. Just have it call your email script once it's done with the backup?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:25 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