James Mackinnon wrote:
Hi All
Hate to ask something that might be a simple answer but I am trying to find
how it is best / easiest to get the CPU usage of a BSD 4.0 box.
I only need the result and not a bunch of other data as I want to store the
result in a mysql db.
Basically i'm just looking for either the idle number or the % used
I have tried with a few different options, but using SNMP (net-snmp 5x) I
can't find the actual % used or idle
any help or suggestions would be ideal. I'm also working on finding the free
memory and some other stuff. I don't want to use MRTG at this point as we are
building a custom management system for custom purposes.
For some real-time data from top(1) try:
$ top -d2 -s2 | grep ^CPU
$ top -d1 -s1 | grep ^Mem
Parse as needed.
-pachl