To get only the cpu info from the topas command terminal


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Lightbulb To get only the cpu info from the topas command terminal

To get only the cpu info from the topas command terminal.

Code:
CPU  User%  Kern%  Wait%  Idle%  Physc   Entc   
  ALL    2.3    4.4    0.0   93.3   0.07    7.7

I tried some thing like this but did not work

Code:
topas << done
  grep "ALL"
  q
  done

Can someone help me in this.
# 2  
The topas tool is a full-screen tool and its output is not well suited for filtering it in a pipeline. I suggest you use vmstat instead, which presents the same information (albeit in different form, but well suited for filtering).

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 3  
Lightbulb

Can you please help me to match these two outputs?

Theses were captured one after other

topas command o/p (Only CPU)

Code:
CPU  User%  Kern%  Wait%  Idle%  Physc   Entc   
ALL    3.1    4.9    0.0   92.0   0.08    9.0


vmstat o/p


Code:
System configuration: lcpu=4 mem=4608MB ent=0.85

kthr    memory              page              faults              cpu
----- ----------- ------------------------ ------------ -----------------------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa    pc    ec
 1  1 447273 571345   0   0   0   9   25   0  21 3802 472  0  0 99  0  0.00   0.0

# 4  
Quote:
Originally Posted by rpm120
Can you please help me to match these two outputs?
No problem. Have a look at vmstats "CPU" part:

us=user(%)
sy=system(=kernel)(%)
id=idle(%)
wa=wait(%)

ec=entitled capacity consumed

"us" is what your running programs need
"sy" are system calls and kernel internals needed to keep the system running
"id"/"wa" is what is left over. Together these 4 values add up to 100% (rounding errors notwithstanding).

The difference between "id" and "wa" is: if the processor is idle and there is an I/O operation outstanding it counts towards "wa", otherwise it counts towards "id".

Entitled capacity consumed is: compare the entitled processing power in the LPAR profile against what in reality is allocated right now and express this as a percentage. "50", for instance, means that half of what the LPAR is entitled to use is in fact used right now.

I hope this helps.

bakunin

/ps: i suggest you try the "-w" and the "-t" options of vmstat: one makes for neater columns and the other includes a time stamp for each line which makes it easier to assess.

/pps: another suggestion: vmstat always displays a summary info as the first output line (not counting headers), so disregard this first line if you want to know something about the system right now.

Last edited by bakunin; 02-11-2014 at 11:51 AM..
This User Gave Thanks to bakunin For This Post:
# 5  
Lightbulb

Thanks a lot bakunin!

The doubt I have is in the results of the commands output.

For Instance,

Let's take the "User%" from the output of the topas command and compare it with
"us" in the vmstat command

It is 3.1 and 0 respectively. They are not matching though they gauge the same.

In the same way all the values such as Kern%,Wait%,Idle%,Physc and Entc from topas and sy,wa,id,pc &ec are not matching.

Infact the sample output's given were captured one after the other in the same server but the results seems to be not matching.
# 6  
Quote:
Originally Posted by rpm120
In the same way all the values such as Kern%,Wait%,Idle%,Physc and Entc from topas and sy,wa,id,pc &ec are not matching.

Infact the sample output's given were captured one after the other in the same server but the results seems to be not matching.
First, the first line of output of "vmstat" should always be ignored, as i said. Because you only have shown one line you should not use this output at all to base any assumption on it. IIRC it displays an average since last reboot or so, which is meaningless.

Second, the system is next to idle. Between 3.1% and 0% there is not much difference and the "load" could well change that much within one or two seconds (the time you needed to stop one and start the other process).

Third, both tools, "topas" and "vmstat" use a certain sampling interval, which is probably not the same per default. I use "topas" only rarely, so i could be wrong, but i believe the default sampling rate to be 2 sec. With "vmstat" there is no default, you have to provide a sampling rate (in secs). I usually start with 1 sec (my internal clock is counting that way) for intensive monitoring and (up to) 60 seconds for long-term observation.

Both, "topas" and "vmstat" get their data from the same OS interfaces, but because they treat these data differently they might end up displaying different values. I have never attempted to search for it, but i am sure you could find the OS calls both are using documented somewhere and you could write your own monitoring tool if you are determined enough. I always found that "vmstat" is giving me the data i need and in a form i can easily manipulate with the abundant UNIX text filters there are (grep, awk, sed, ksh, ....). This is why i myself use "vmstat" and hardly ever "topas": personal preference rather than technical reasons.

I hope this clears it up.

bakunin
This User Gave Thanks to bakunin For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Topas - CPU count inconsistent across LPARs
maraixadm
seeing weirdness across some 7.1.5.1 LPARs - they all have 2 vCPUs allocated shared. With prtconf they show 2 CPUs, 'lsdev -c processor' concurs, and 'lsattr -El procX' shows that SMT is enabled and there are 2 SMT threads (power5, sorry). Yet running topas on them shows 2 CPUs on some and 4 on...... AIX
3
AIX
topas and mpstat disagree on CPU count
petervg
I have a number of LPARs on one P520. All LPARs are running 5.3 and I observe the following: On some LPARs the number of CPUs found do not match between topas and mpstat. Server 1: $ mpstat System configuration: lcpu=4 ent=0.2 mode=Uncapped cpu min maj mpc int cs ics rq ...... AIX
1
AIX
Generic command for CPU info
sgoiffon
Dear all, Is there any generic command working on all Unix listing the CPU of a server? I found different command line per OS but I am looking for a more generic one. Thanks for your answer.... Shell Programming and Scripting
5
Shell Programming and Scripting
CPU Info
yoavbe
Hi, I am going to buy a software that is licenced per CORE. I have a HPUX B1123 64 bit with 8 cpus. How can i know how many cores are in my machine ? Thanks... HP-UX
3
HP-UX
cpu info
vijayca
is there a single command or location from which one can get information like cpu Mhz,cpu cache...etc in HP UX:)... HP-UX
1
HP-UX