# Checking CPU load per core on a SMP system



## cpeterson (Jan 9, 2009)

So, I got stuck assisting the monitoring team with configuring nagios to monitor our few hundred freeBSD boxes.

I got stuck at the question of "how do we monitor the load on each CPU core?". I know in 7.1 top -P will spit out something similar to what I'm looking for, but sadly we're still on 6-STABLE in most places, and actually still have a few 4.10 boxes kicking around.

So, is there any way to get the CPU usage statistics per core in the 6-STABLE branch?

Thanks!


----------



## ale (Jan 10, 2009)

`$ top -P` should work on 6-STABLE too.


----------



## brd@ (Jan 10, 2009)

Judging from this:

http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/top/machine.c

You'd need to run at least FreeBSD 6.4, though you could probably MFC the changes to the code to 4.x if you felt comfortable doing so. I would really recommending moving to at least 6.4 or 7.1 so you could use freebsd-update


----------



## Oko (Jan 10, 2009)

```
systat
```
should work for you on 6.3 and below.


----------



## vermaden (Jan 10, 2009)

on older FreeBSD releases use [cmd=]top -S[/cmd]


----------



## cpeterson (Jan 12, 2009)

Thanks for the suggestions, top -S looks like it should do what I need once I wrap it with a sh script.

Systat would work too, but it's less easy than just running grep on "top -S -b" to automate the checking.


----------

