To get only the cpu info from the topas command terminal


 
Thread Tools Search this Thread
Operating Systems AIX To get only the cpu info from the topas command terminal
# 1  
Old 02-10-2014
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  
Old 02-10-2014
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  
Old 02-11-2014
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  
Old 02-11-2014
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 12:51 PM..
This User Gave Thanks to bakunin For This Post:
# 5  
Old 02-13-2014
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  
Old 02-13-2014
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 Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Topas - CPU count inconsistent across LPARs

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... (3 Replies)
Discussion started by: maraixadm
3 Replies

2. AIX

Need help on topas command

Hi, how to grep data from topas command...for example i have to grep owner from topas command Thanks (2 Replies)
Discussion started by: sumanthupar
2 Replies

3. Shell Programming and Scripting

Help with topas command

How do i display only one iteration of topas command. Ideally i would topas -P to show only one instance rather than keep on running. is there any swicth? (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

4. AIX

topas and mpstat disagree on CPU count

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 ... (1 Reply)
Discussion started by: petervg
1 Replies

5. UNIX for Dummies Questions & Answers

Help with TOPAS command

I used the TOPAS command to get top 20 process information by routing the output to a file. But the output is not very readable. can ayone explain how to read the output, or how to interpret the information? Thanks! (3 Replies)
Discussion started by: ginnyr1
3 Replies

6. Shell Programming and Scripting

Generic command for CPU info

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. (5 Replies)
Discussion started by: sgoiffon
5 Replies

7. HP-UX

CPU Info

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 (3 Replies)
Discussion started by: yoavbe
3 Replies

8. UNIX for Dummies Questions & Answers

command topas

hi, everybody i have a problem about performane in unix when i run topas, there 1 form show, there are many parameter about memory,cpu,.... i want to know detail about those example : MEMORY Real,MB 12287 % Comp 25.0 % Noncomp 75.8 % Client 0.5 comp mean ? 25 mean ? 25MB or 25%memory... (6 Replies)
Discussion started by: tokienlua
6 Replies

9. HP-UX

cpu info

is there a single command or location from which one can get information like cpu Mhz,cpu cache...etc in HP UX:) (1 Reply)
Discussion started by: vijayca
1 Replies

10. UNIX for Dummies Questions & Answers

bus speed and CPU info

Hi, Is there a command I can use to find out how many CPU's and what type are on my server? (I was told to use cat /proc/cpuinfo) Also, how do I know what kind of bus speeds are on my server? Thanks in advance:) (3 Replies)
Discussion started by: ihot
3 Replies
Login or Register to Ask a Question