the mib ssCpuRawIdle (1.3.6.1.4.1.2021.11.53.0) is defined in /usr/share/snmp/mibs/UCD-SNMP-MIB.txt as "percentages of system CPU time."
but when I ask for it, I get:
$snmpwalk -v 1 -c public 192.168.2.42 ssCpuRawIdle enterprises.ucdavis.systemStats.ssCpuRawIdle.0 = Counter32: 109112529
what is 109112529?
i'd love a percentage, like 99% or something. What's up with 109 million?
ideas?
mrb
From: http://www.net-snmp.org/FAQ.html#How_do_I_get_percentage_CPU_utilization_using_ssCpuRawIdle_
What do the CPU statistics mean - is this the load average? ----------------------------------------------------------
No. Unfortunately, the original definition of the various CPU statistics was a little vague. It referred to a "percentage", without specifying what period this should be calculated over. It was therefore implemented slightly differently on different architectures.
Recent releases includes "raw counters", which can be used to calculate the percentage usage over any desired period. This is the "right" way to handle things in the SNMP model. The original flawed percentage objects should not be used, and will be removed in a future release of the agent.
Note that this is different from the Unix load average, which is available via the loadTable, and is supported on all architectures.
How do I get percentage CPU utilization using ssCpuRawIdle? -----------------------------------------------------------
This one of the "raw counters" mentioned in the previous entry. You need to take two readings of this object and look at the difference between them. That difference divided by the total number of 'ticks' between the two readings (where one tick is probably 0.01 seconds) will give you the percentage utilization over that period.
So it is not just a simple percentage in reality, and so shouldn't be treated like a gauge in MRTG (which is what I assume you are using this for). It also counts the IDLE time, not the BUSY time, so if the CPU is not doing anything it will be graphed at 100% IDLE, and if it is fully BUSY, it would be graphed as 0% IDLE. Kind of backwards to what most people are expecting.
You could have it graph it as 100-IDLE to get the BUSY number, I suppose.
But probably the better way (or at least the way it is done most commonly that I can find) is to sum User, System, and Nice. There is an example of how to get CPU usage from net-snmp by summing in MRTG here:
http://net-snmp.sourceforge.net/tutorial/mrtg/
That shows (as the first example) what graphing ssCpuRawIdle would look like (an inverted graph), while further down it shows (under "Active CPU") the summing method. Compare the two graphs side by side to see what I mean.
Adam Augustine
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
