check_cpu_usage plugin?

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Mar 30 05:04:16 CEST 2007


Actually, the exact meaning is the average number of process on the CPU
run queue. For example if you have two processes running constantly (ex.
number-crunching applications) you load average will be always 2 (or
higher if there's other programs running).

Since the run queue does not have a upper limit like the CPU usage
percent, the meaning is slightly different. For example on a quad
processor system that runs many process the load can climb pretty high
without the CPU being fully utilized because at some times you might
have 200 processes on the run queue, and at other times there will be
none, so the average will be high.

The average CPU usage, on the other hand, can't be higher that 100%.
This means that when you approach the upper limit under normal load you
know you're hitting the limit of your server, so this might be a much
more precise indication that you need a faster server.

About the check question, I don't know of any standalone check beside
INTEGER SNMP OIDs:

UCD-SNMP-MIB::ssCpuUser.0 (.1.3.6.1.4.1.2021.11.9.0)
UCD-SNMP-MIB::ssCpuSystem.0 (.1.3.6.1.4.1.2021.11.10.0)
UCD-SNMP-MIB::ssCpuIdle.0 (.1.3.6.1.4.1.2021.11.11.0)

However, these are not very precise and to better monitor the CPU usage
I suggest to graph (using MRTG, Cacti and the like) the CPU usage from
the Raw values (These are counters that have to be polled and then the
average usage is calculated based on the time between pools). You can
optionally write a check script that will then extract the 1-minute,
5-minute, etc. average from the RRD file using rrdtools. Cacti has a
plugin for that if you don't know how to do it, though you won't have
1-minute pooling (even though Cacti has a 1-minute patch it requires
much more modifications to have it work properly)

Raw OIDs that can be pooled (there may be more or less depending on the
system:

UCD-SNMP-MIB::ssCpuRawUser.0 (.1.3.6.1.4.1.2021.11.50.0)
UCD-SNMP-MIB::ssCpuRawNice.0 (.1.3.6.1.4.1.2021.11.51.0)
UCD-SNMP-MIB::ssCpuRawSystem.0 (.1.3.6.1.4.1.2021.11.52.0)
UCD-SNMP-MIB::ssCpuRawIdle.0 (.1.3.6.1.4.1.2021.11.53.0)
UCD-SNMP-MIB::ssCpuRawWait.0 (.1.3.6.1.4.1.2021.11.54.0)
UCD-SNMP-MIB::ssCpuRawKernel.0 (.1.3.6.1.4.1.2021.11.55.0)
UCD-SNMP-MIB::ssCpuRawInterrupt.0 (.1.3.6.1.4.1.2021.11.56.0)
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 (.1.3.6.1.4.1.2021.11.61.0)


Thomas


On 29/03/07 05:10 PM, ffwqe efwa wrote:
> Andy,
>  
> I was under the impression that load was more indicative on process-wait
> for cpu cycles and general system performance than actual cpu usage. 
> For example, heavy processor wait on disk IO could cause high load
> without actually consuming CPU usage, amongst other things.  Am I
> incorrect?
>  
> If I can rely on check_load to return .50 in a 5 minute average if 50%
> of the cpu is used for five minute straight this should work for me
> needs.  My gut feeling tells me it never quite works this way. 
> Additionally, can't a momentary amount of high load (greater than 1.0 or
> 100% cpu) cause a number above 1/100% to be averaged in and cause these
> measurements to be off?
>  
> Although it could be nice to monitor cpus individually in a multi-cpu
> system for hung processes, etc, I can live without this if check_load
> works nicely.
>  
> Thanks!
>  
>  
> On 3/29/07, *Andy Shellam* <andy.shellam-lists at mailnetwork.co.uk
> <mailto:andy.shellam-lists at mailnetwork.co.uk>> wrote:
> 
>     That's exactly what the load average is - it shows how busy the
>     processor is/has been over the last 1 minute, 5 minutes and 15 minutes.
> 
>     http://en.wikipedia.org/wiki/Load_(computing)
> 
>     Andy.
> 
> 
>     ffwqe efwa wrote:
>     >
>     > Simple question -- is there a plugin or easy method to check for
>     > processor usage over either a 1 minute or 5 minute average on linux
>     > machines?  There's a check_load plugin, but I can't find anything that
>     > would easily function as a check_cpu plugin.
>     > !DSPAM:37,460c269a103001795015003!

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list