1847950 Members
4693 Online
104021 Solutions
New Discussion

Re: Monitoring maxuprc

 
SOLVED
Go to solution
Yvonne Butler
Regular Advisor

Monitoring maxuprc

Is there a way of seeing the current user processes on a system. Or to word it a littler better - if the kernel parameter "maxuprc" is set to say 1500, is there a commmand I can use to see if the system is getting near the set limit? Even better, does anyone have a script!?
6 REPLIES 6
Joseph Loo
Honored Contributor
Solution

Re: Monitoring maxuprc

hi,

i would think:

# ps -ef|wc -l
would give you the number of processes running on that server.

regards.
what you do not see does not mean you should not believe
Rajesh D L
Frequent Advisor

Re: Monitoring maxuprc

Hi,

maxuprc is the maximum number of processes a particular user can start on the system. ps -ef |grep "user name " |wc -l may give the approx number.

regards,
RDL.
Yvonne Butler
Regular Advisor

Re: Monitoring maxuprc

Oh it's that simple is it!? I was trying to think of a more complex solution Thanks very much everyone...
twang
Honored Contributor

Re: Monitoring maxuprc

Add to above reply, you can also use the following:
# ps -fu |wc -l
Tonya Underwood
Regular Advisor

Re: Monitoring maxuprc

You can also write up a little script and capture the output. This way you will have historical statistics in case the issue occurs and you are not notified until AFTER... which so often occurs!

# more procs_per_user.sh
#!/bin/ksh
##
##
#************************************************************
#* *
#* *
#* *
#************************************************************
MAXUPRC_LOGFILE=/var/tmp/userprocs.log
INTERVAL=1800

while true
do
user=`ps -ef | awk '{print $1}' | sort -u | grep -v UID`
for x in $user
do
userproc=`ps -ef |grep $x |wc -l`
echo "`date | awk '{print $2,$3,$4}'` USER: $x\t NUMBER OF PROCESSES:\t$userproc" >> $MAXUPRC_LOGFILE
done
sleep $INTERVAL
echo "\n************************************************************************\n" >> MAXUPRC_LOGFILE
done

If you want you can even add some alerting in there... or a threshold where, when reached, the logging interval is cut in half and in half and in half until the number is over that threshold again... at which point, the logging interval could return to normal.

Hope this helps!
Tonya Underwood
Yvonne Butler
Regular Advisor

Re: Monitoring maxuprc

Again, thanks everyone. I've already written myself a script to monitor the process levels and send out an e-mail at a set threshold below the maxuprc.