Identify the source of High CPU
I am running a BSD box with monitoring configured via SNMP. I am getting randon high CPU spikes and am trying to identify the cause.
Currently I have a cron running every 5 minutes to get an output from 'ps' and getting the top processes aswell as a 'vmstat 1 10' but it looks like the high CPU may occur outside the cron times.
Instead of changing the cron to run every 1 minute or so, is there a better way to identify what is causing the high cpu?
ie: when High CPU is triggered, to get an output of the current processes running?
Thanks in advance,