CPUSTAT

Hey guys,

I am stuck here. I try to give cpustat and and it asks me to give more options like

Usage:

cpustat [-c events] [-nhD] [interval [count]]

-c events specify processor events to be monitored

-nsuppress titles

-tinclude %tick register

-Denable debug mode

-hprint extended usage information

Use cputrack(1) to monitor per-process statistics.

I dont have a idea what other options i need to give (like what is events, etc). Can someone help...? :(

Jackie

[532 byte] By [Jackie] at [2007-11-26 10:12:42]
# 1
Well doing a "man cpustat" would be a good start.Also you havent said what your actually trying to measure.Or why you think that cpustat is the right tool to be using.If you just want general CPU usage then prstat might be more useful.
robertcohen at 2007-7-7 2:01:15 > top of Java-index,General,Sun Networking Services and Protocols...
# 2
I am trying to make some sense out of this below script.cpustat=`/usr/local/bin/sudo rsh -n <server name> sysstat -c 1 1 | tail -1 | awk '{print $1}' | cut -d"%" -f1`Can you tell me what exactly this does?Jackie
Jackie at 2007-7-7 2:01:15 > top of Java-index,General,Sun Networking Services and Protocols...
# 3

Well, it appears to be trying to run a program called sysstat.

But there isnt a program of that name on solaris.

There is a general package named sysstat which contains programs like iostat.

But even that package doesnt include a program named sysstat.

So in short I don't know what is trying to do.

I can make a guess that its trying the find the percentage of CPU used at the moment.

This comes fairly close

cpustat=`/usr/local/bin/sudo rsh -n <server name> vmstat 1 2 | tail -1 | awk '{print $20 +$21}' `

robertcohen at 2007-7-7 2:01:15 > top of Java-index,General,Sun Networking Services and Protocols...
# 4

Thank you for the quick response. It is great feeling that someone wants to share his knowledge here.

After seeing your code, i tried a few tricks and it got it fine. I actually did get the CPU % used.

One more issue

When i use the mailx option from a server, i get a mail in my mail client in my own name. Is it b'cos i have logged into the server using my login ID and then su into root. Or is it taking something else.

Which takes precedence? Login ID or Root?

Jackie

Jackie at 2007-7-7 2:01:15 > top of Java-index,General,Sun Networking Services and Protocols...