On Tue, 27 Nov 2007 02:42:39 +0700, NetOne - Doichin Dokov <[EMAIL PROTECTED]> wrote:
It seems net-snmp gives wrong data about CPU usage on OpenBSD. This is the data that i get (i've snipped some irrelevant OIDs) # snmpwalk -v2c -c community localhost .1.3.6.1.4.1.2021.11 UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1196105427 UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 386973 UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 1179540172 UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 1196105427 UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 1 UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 1179540171 These are the same counters, but after some minutes: # snmpwalk -v2c -c community localhost .1.3.6.1.4.1.2021.11 UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1196105547 UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 633528 UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 1179540175 UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 1196105547 UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 4 UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 1179540171 The SNMP data shows lots of NICE activity and nothing for interrupts. In the same time, top reports this: CPU0 states: 0.6% user, 0.0% nice, 1.0% system, 32.9% interrupt, 65.5% idle The SNMP counters seem completely irrelevant to CPU usage. Here's another example of two consecutive snmpwalks, executed right after each other: # snmpwalk -v2c -c community localhost .1.3.6.1.4.1.2021.11 UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1196105672 UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 890340 UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 1179540175 UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 4294865120 UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 1297536800 # snmpwalk -v2c -c community localhost .1.3.6.1.4.1.2021.11 UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0 UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 100 UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 65536 UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 1297536800 UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 4294865120 UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0 UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 1297536800 Counters are completely irrelevant, look at ssCpuRawUser and ssCpuRawNice. Am I doing something wrong? What is the proper way to get CPU stats off OpenBSD with net-snmp? I know the ticks are 10 000 by default on OpenBSD, so I'm dividing the values accordingly, but still i don't get proper stats. Anyone any ideas? Regards, Doichin # uname -a OpenBSD host.name.com 4.2 GENERIC.MP#0 amd64
Hi, You should really checkout this site http://www.packetmischief.ca/openbsd/snmp/ Cool.. cu, Insan -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/