Sponsored Content
Full Discussion: Prstat substitute
Contact Us Post Here to Contact Site Administrators and Moderators How to Post in the The UNIX and Linux Forums Prstat substitute Post 302957368 by cjcox on Friday 9th of October 2015 05:53:39 PM
Old 10-09-2015
Apples vs. oranges with regards to NLWP counts... but let's see what is possible.... I have no idea if your logic will be sound... the systems are quite different.

replace:
Code:
v_gap_prstat_line=`prstat -p ${v_gpsd_pid} 5 1 | grep -vi TOTAL | grep -v CPU`

with:
Code:
v_gap_prstat_line=`top -b -n 1 -p ${v_gpsd_pid}  | tail -n 1`

For the NWLP number... well, perhaps if you get a thread list... so things change a bit.

change:
Code:
THREAD_COUNT_INSTANCE=`echo ${v_gap_prstat_line} | awk '{ print $10 }' | cut -d/ -f2`

try instead:
Code:
THREAD_COUNT_INSTANCE=`top -b -n 1 -H -p ${v_gpsd_pid}  | grep '^[ ]*[0-9]' | wc -l`

No warranties

---------- Post updated at 04:53 PM ---------- Previous update was at 04:51 PM ----------

Oh... and I just did -n 1... feel free to adjust... might need more work, but certainly on the right path (I think)
This User Gave Thanks to cjcox For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with prstat

Hello, The last line of prstat shows load average. I am unable to figure out what actually it is. I have read the man pages and also googled, all for no use. Can somebody help me, as to what should be the avg. load of the system for best performance and how is this load of prstat calculated. (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

2. Shell Programming and Scripting

prstat in shell

Hello, How can I do to use prstat command in a korn-shell ? Thanks a lot. Rgds. (4 Replies)
Discussion started by: madmat
4 Replies

3. Shell Programming and Scripting

prstat problem

This will be a smaple output for my prstat -t NPROC USERNAME SIZE RSS MEMORY TIME CPU 43 root 249M 62M 1.5% 33:50:01 0.1% 12 oadmin 1396M 862M 22% 0:06:49 0.1% 2 acne 3960K 3176K 0.1% 0:00:00 0.0% 4 essagent 10M 7456K 0.2% 0:00:00 0.0%... (6 Replies)
Discussion started by: vivsiv
6 Replies

4. Shell Programming and Scripting

Script using prstat

Hi, I need a script which uses prstat command to check the performance . if a load averages crosses some threshold means I should receive the mail. this script should always run in back ground. Kindly help me on this. (1 Reply)
Discussion started by: jayaramanit
1 Replies

5. Solaris

prstat O/P

Good Evening everyone, I am confused about prstat O/P as it shows memory values which are different from actual value.Below is the O/P of prstat command and swap commands. NPROC USERNAME SIZE RSS MEMORY TIME CPU 48 root 2113M 1590M 1.2% 45:09.39 32% 31 daemon ... (7 Replies)
Discussion started by: vvpotugunta
7 Replies

6. Shell Programming and Scripting

prstat

hi all, am writing a ksh script on solaris 9 to get the number of threads taken by a process. am using the prstat -p command to do this. output i get is : :"/export/home/user" > prstat -p 25528 | cut -f2 -d/ NLWP 203 Total: 1 processes, 203 lwps, load averages: 2.58, 3.24, 3.62... (2 Replies)
Discussion started by: cesarNZ
2 Replies

7. Solaris

prstat

hi all, was trying to figure out how busy my app was by looking at the performance of the app server. did a 'prstat -s rss' command to find the app servers using most memory. Found a command 'prstat -m' which is meant to show more details on each pid but the output of this command... (1 Reply)
Discussion started by: cesarNZ
1 Replies

8. Shell Programming and Scripting

prstat output

hi all, have a ksh script where i am doing a prstat -m -u osuser 1 1 >> $FILE_NAME but for some reason it only writes 15 lines wheres when i run the same command manually from command prompt it prints out 60 lines. why is it not writing the full 60 lines to the file ?? ta. (1 Reply)
Discussion started by: cesarNZ
1 Replies

9. Shell Programming and Scripting

prstat with ksh

trying to have prstat into a file on a Solaris machine. Would like to have the prstat run from a cron every 30 min. print 300 lines+ date. Date is not printed, only the prstat, and ksh does not end, it stays running... #!/bin/ksh # ---------------------------------------------------- #... (4 Replies)
Discussion started by: pointer
4 Replies

10. Solaris

Understanding prstat

Hello We have a SPARC box running Solaris 10. We have 32 GB of physical memory, 32 GB of swap. Now i want to monitor memory usage for performance tuning. The box is running Sybase database. When I type prstat i get the following PID USERNAME SIZE RSS STATE PRI NICE TIME CPU... (4 Replies)
Discussion started by: abohmeed
4 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy