KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Number of processes script

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
mos-eisley



Joined: 21 Mar 2007
Posts: 76
Location: Klarup (AAlborg), Demark

PostPosted: Fri Jun 29, 2007 12:19 am    Post subject: Number of processes script Reply with quote

We have made Our own process count script, as many we monitor are different java app on the save server, so we nedd 2 parameters to grep for. The re is room for improvemnt, like testing for 3 or 4 parameters first etc.

The input is 3 or 4 parameters, like:

java 1 10 weblogic.server

PROCNAME=$1
MIN=$2
MAX=$3
PROCNAME2=$4

if [ $PROCNAME2 = "" ]
then

PROCS=`ps -ef | grep "$PROCNAME" | grep -v "grep" | grep -v "$0" | grep -v $PPID`

else

PROCS=`ps -ef | grep "$PROCNAME" | grep "$PROCNAME2" | grep -v "grep" | grep -v "$0" | grep -v $PPID`

fi

NUMOFPROCS=`echo "$PROCS" | wc -l`

if [ $NUMOFPROCS -lt $MIN ] || [ $NUMOFPROCS -gt $MAX ]
then

RESULT="Bad"

else

RESULT="Ok"

fi

echo "ScriptRes:$RESULT:$NUMOFPROCS process(es)"
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index