1837113 Members
2127 Online
110112 Solutions
New Discussion

Re: CPU utilisation

 
Praveen Bezawada
Respected Contributor

CPU utilisation

Hi
Are there any commands which give output of CPU utilisation that can be used as input for other commands.
I tried top but it could not be piped.
Please help...
Thanks in advance.
..Praveen
6 REPLIES 6
Vikas Khator
Honored Contributor

Re: CPU utilisation

Hi ,

You can use sar -u .

Also vmstat gives you CPU utilization.

Keep it simple
Suhas_2
Regular Advisor

Re: CPU utilisation

Praveen,
If you have measureware installed on your systems you
can make use of the "extract" command.
Pls try. It gives you very good reports of resource utilization. That eliminates the need to pipe any output
to any other command. You can, then, generate nice and informative reports, that help you in capacity planning.

Rgds,...
Suhas.
Never say "Die"
jherring
Regular Advisor

Re: CPU utilisation

sar -u 5 5 is the best and is the most accurate tool to measure this. top is not always as accurate as sar.

sar -uM 5 5 if multiple processors.

Jon
Jitendra_1
Trusted Contributor

Re: CPU utilisation

You can use sar to direct the output to a file . In addition use uptime to check the cpu load averages.
Learning is the Key!
Steven Sim Kok Leong
Honored Contributor

Re: CPU utilisation

Hi,

If you would like to plot cpu load averages graphically on the web, you can feed a MRTG grapher with the OID value of 1.3.6.1.4.1.11.2.3.1.1.3.0 via snmpget over the network.

Be sure however to check that the snmp daemon is running on that system.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Kent Arnott_1
New Member

Re: CPU utilisation

You can use top to get what you need...

$topout=`export TERM=ansi; /usr/bin/top -d 1 |/usr/bin/grep avg`;

I use this to get the line with avg cpu time on it and then run it through perl to get the avg times...