mpstat/vmstat disagree with top
Using vmstat 1, it will slowly adjust to the correct numbers, but I need to get that data on the fly from the command line. Any way I could just cut the crap and skip right to the "real" numbers?
3 Replies
munin has a "cpu" plugin that handles all this for you.
@bastawhiz:
…I need to get that data on the fly from the command line. Any way I could just cut the crap and skip right to the "real" numbers?
As I recall, top displays the same load average numbers found in the file /proc/loadavg. On the command line, you might use:
cat /proc/loadavg
James
If you can wait a second for the result you can use something like this:
$ vmstat 1 2 |tail -1
Otherwise you need a daemon like munin watching it for you all the time.