[HPADM] Summary: ps scripting help
From: Ken Felmly (kfelmly_at_h40a.resva.trw.com)
Date: 05/14/03
- Previous message: Eric Hunter: "[HPADM] OpenOffice.org"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 14 May 2003 16:35:35 -0400 To: "hpux-admin@dutchworks.nl" <hpux-admin@dutchworks.nl>
Sorry for the late summary:
Essentiallt I removed the 2nd $ in $PROCESS$ and it works now.
Thanks for all of the very helpful replies.
Kenny
This is my script:
#!/usr/sbin/sh
MUSTRUN="LISTENER"
while true
do
ALLPROCS=`ps -ef`
for PROCESS in $MUSTRUN
do
echo "$ALLPROCS" | grep -q " $PROCESS$"
if [ $? -eq 1 ]
then
echo "$PROCESS not running!"
<other commands...>
fi
done
done
Original post:
More information:
I have a 2-node cluster with 3 SIDs. 2 are 8.0.6 and 1 is 8.1.7. I
need to run 3 seperate listeners so that when any of the SIDs die, then
the adoptive node gets the SID with its associated listener. In other
words, when package 2 fails, I don't want the listener shutdown for the
other SIDs.
What I am confused about is that the ps -ef | grep -q returns a 0 for
running processes that end with the name I am grepping for where the
processes that have the name within the output (not the last field) it
returns a 1.
In essence a server could be running 3 different listeners on different
services ports and I don't want 1 package to shutdown all of the
listeners if the other 2 are ok.
I am trying to run a monitor script that checks for all the Oracle sids
and the listener.
MUSTRUN = "ora_pmon ora_smon ora_lgwr LISTENER"
ALLPROCS=`ps -ef`
the ps -ef |grep -q " $Process$ returns a 0 for all the "ora_" but the
LISTENER returns a 1 blowing out the script.
Near as I can figure, the ps -ef only sees the last entry in the ps -ef
command (field 9).
When I put the word "-inherit" (field 10) the script returns a 0 for all
procs.
--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl
Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
- Previous message: Eric Hunter: "[HPADM] OpenOffice.org"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|