Paul Koch
2014-Mar-18 04:41 UTC
bsnmp HOST-RESOURCES.hrStorageSize odd value for real memory metrics
Hi,
I have two quad core i5, 16G ram machines, running 10.0-Release and
9.2-Release. Both exhibit the same problem where a walk of the snmp
object HOST-RESOURCES.hrStorageSize returns an unexpected value for its
real memory metrics.
This is a walk of one of the boxes... I've cut it down bit to fit..
-----------------------------------------------
walk 10.1.8.80 version 2 community public HOST-RESOURCES-MIB.host
hrSystemUptime 0 TimeTicks 169459
hrSystemDate 0 DateAndTime 2014-03-18 13:49:23 +600
hrSystemInitialLoadDevice 0 Integer 0
hrSystemInitialLoadParameters 0 DisplayString /boot/kernel/kernel
hrSystemNumUsers 0 Gauge32 1
hrSystemProcesses 0 Gauge32 100
hrSystemMaxProcesses 0 Integer 6164
hrMemorySize 0 Integer 16663744
hrStorageIndex 1 Integer 1
hrStorageIndex 2 Integer 2
hrStorageIndex 3 Integer 3
...
hrStorageType 1 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam
hrStorageType 2 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam
hrStorageType 3 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageVirtualMemory
hrStorageType 4 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS
hrStorageType 5 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSOther
hrStorageType 6 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS
hrStorageType 7 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS
hrStorageType 8 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSNFS
hrStorageType 9 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam
...
hrStorageDescr 1 DisplayString Real Memory Metrics
hrStorageDescr 2 DisplayString Shared Real Memory Metrics
hrStorageDescr 3 DisplayString Swap:/dev/gpt/simulator-swap
hrStorageDescr 4 DisplayString /, type: ufs, dev: /dev/gpt/simulator-root0
hrStorageDescr 5 DisplayString /dev, type: devfs, dev: devfs
hrStorageDescr 6 DisplayString /alt, type: ufs, dev: /dev/gpt/simulator-root1
hrStorageDescr 7 DisplayString /home, type: ufs, dev: /dev/gpt/simulator-home
hrStorageDescr 8 DisplayString /home/distfiles, type: nfs, dev:
10.1.8.20:/home/distfiles
...
hrStorageAllocationUnits 1 Integer 4096
hrStorageAllocationUnits 2 Integer 4096
hrStorageAllocationUnits 3 Integer 4096
hrStorageAllocationUnits 4 Integer 4096
hrStorageAllocationUnits 5 Integer 512
hrStorageAllocationUnits 6 Integer 4096
hrStorageAllocationUnits 7 Integer 4096
hrStorageAllocationUnits 8 Integer 512
hrStorageAllocationUnits 9 Integer 208
...
hrStorageSize 1 Integer 2319048
hrStorageSize 2 Integer 1593
hrStorageSize 3 Integer 1048544
hrStorageSize 4 Integer 1265407
hrStorageSize 5 Integer 2
hrStorageSize 6 Integer 1265407
hrStorageSize 7 Integer 238615252
hrStorageSize 8 Integer 1822049168
hrStorageSize 9 Integer 0
...
hrStorageUsed 1 Integer 2284267
hrStorageUsed 2 Integer 1462
hrStorageUsed 3 Integer 200
hrStorageUsed 4 Integer 814815
hrStorageUsed 5 Integer 2
hrStorageUsed 6 Integer 4
hrStorageUsed 7 Integer 2875148
hrStorageUsed 8 Integer 456220992
hrStorageUsed 9 Integer 89
...
hrStorageAllocationFailures 1 Counter32 0
hrStorageAllocationFailures 2 Counter32 0
hrStorageAllocationFailures 3 Counter32 0
hrStorageAllocationFailures 4 Counter32 0
hrStorageAllocationFailures 5 Counter32 0
hrStorageAllocationFailures 6 Counter32 0
hrStorageAllocationFailures 7 Counter32 0
hrStorageAllocationFailures 8 Counter32 0
hrStorageAllocationFailures 9 Counter32 0
-------------------------------------------------
hrStorageSize extract from HOST-RESOURCES-MIB
hrStorageSize OBJECT-TYPE
SYNTAX Integer32 (0..2147483647)
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The size of the storage represented by this entry, in
units of hrStorageAllocationUnits. This object is
writable to allow remote configuration of the size of
the storage area in those cases where such an
operation makes sense and is possible on the
underlying system. For example, the amount of main
memory allocated to a buffer pool might be modified or
the amount of disk space allocated to virtual memory
might be modified."
::= { hrStorageEntry 5 }
From dmesg:
real memory = 17179869184 (16384 MB)
sysctl -a | grep physmem
hw.physmem: 17063673856
The value for "hrStorageSize 1 Integer 2319048" should actually
be something like 4194304 (ie. 16G/4096)
Also, the value keeps changing as memory use changes, which is
actually the job for hrStorageUsed not hrStorageSize.
We installed net-snmp on one of the boxes, and even though we have no
confidence in net-snmp, it does appear to return the correct values
for hrStorageSize.
Looks like a bug somewhere in usr.sbin/bsnmpd/modules/snmp_hostres/
but I've only had a quick look and can't quite follow what is going on.
Makes this part of the table fairly useless for monitoring.
Paul.
--
Paul Koch
Brisbane, Australia (+10 GMT/UTC)
Mikolaj Golub
2014-Mar-23 15:43 UTC
bsnmp HOST-RESOURCES.hrStorageSize odd value for real memory metrics
On Tue, Mar 18, 2014 at 02:41:19PM +1000, Paul Koch wrote:> Hi, > > I have two quad core i5, 16G ram machines, running 10.0-Release and > 9.2-Release. Both exhibit the same problem where a walk of the snmp > object HOST-RESOURCES.hrStorageSize returns an unexpected value for its > real memory metrics. > > This is a walk of one of the boxes... I've cut it down bit to fit.. > > ----------------------------------------------- > > walk 10.1.8.80 version 2 community public HOST-RESOURCES-MIB.host > > hrSystemUptime 0 TimeTicks 169459 > hrSystemDate 0 DateAndTime 2014-03-18 13:49:23 +600 > hrSystemInitialLoadDevice 0 Integer 0 > hrSystemInitialLoadParameters 0 DisplayString /boot/kernel/kernel > hrSystemNumUsers 0 Gauge32 1 > hrSystemProcesses 0 Gauge32 100 > hrSystemMaxProcesses 0 Integer 6164 > hrMemorySize 0 Integer 16663744 > hrStorageIndex 1 Integer 1 > hrStorageIndex 2 Integer 2 > hrStorageIndex 3 Integer 3 > ... > hrStorageType 1 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam > hrStorageType 2 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam > hrStorageType 3 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageVirtualMemory > hrStorageType 4 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS > hrStorageType 5 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSOther > hrStorageType 6 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS > hrStorageType 7 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSBerkeleyFFS > hrStorageType 8 ObjectIdentifier HOST-RESOURCES-TYPES.hrFSNFS > hrStorageType 9 ObjectIdentifier HOST-RESOURCES-TYPES.hrStorageRam > ... > hrStorageDescr 1 DisplayString Real Memory Metrics > hrStorageDescr 2 DisplayString Shared Real Memory Metrics > hrStorageDescr 3 DisplayString Swap:/dev/gpt/simulator-swap > hrStorageDescr 4 DisplayString /, type: ufs, dev: /dev/gpt/simulator-root0 > hrStorageDescr 5 DisplayString /dev, type: devfs, dev: devfs > hrStorageDescr 6 DisplayString /alt, type: ufs, dev: /dev/gpt/simulator-root1 > hrStorageDescr 7 DisplayString /home, type: ufs, dev: /dev/gpt/simulator-home > hrStorageDescr 8 DisplayString /home/distfiles, type: nfs, dev: 10.1.8.20:/home/distfiles > ... > hrStorageAllocationUnits 1 Integer 4096 > hrStorageAllocationUnits 2 Integer 4096 > hrStorageAllocationUnits 3 Integer 4096 > hrStorageAllocationUnits 4 Integer 4096 > hrStorageAllocationUnits 5 Integer 512 > hrStorageAllocationUnits 6 Integer 4096 > hrStorageAllocationUnits 7 Integer 4096 > hrStorageAllocationUnits 8 Integer 512 > hrStorageAllocationUnits 9 Integer 208 > ... > hrStorageSize 1 Integer 2319048 > hrStorageSize 2 Integer 1593 > hrStorageSize 3 Integer 1048544 > hrStorageSize 4 Integer 1265407 > hrStorageSize 5 Integer 2 > hrStorageSize 6 Integer 1265407 > hrStorageSize 7 Integer 238615252 > hrStorageSize 8 Integer 1822049168 > hrStorageSize 9 Integer 0 > ... > hrStorageUsed 1 Integer 2284267 > hrStorageUsed 2 Integer 1462 > hrStorageUsed 3 Integer 200 > hrStorageUsed 4 Integer 814815 > hrStorageUsed 5 Integer 2 > hrStorageUsed 6 Integer 4 > hrStorageUsed 7 Integer 2875148 > hrStorageUsed 8 Integer 456220992 > hrStorageUsed 9 Integer 89 > ... > hrStorageAllocationFailures 1 Counter32 0 > hrStorageAllocationFailures 2 Counter32 0 > hrStorageAllocationFailures 3 Counter32 0 > hrStorageAllocationFailures 4 Counter32 0 > hrStorageAllocationFailures 5 Counter32 0 > hrStorageAllocationFailures 6 Counter32 0 > hrStorageAllocationFailures 7 Counter32 0 > hrStorageAllocationFailures 8 Counter32 0 > hrStorageAllocationFailures 9 Counter32 0 > > ------------------------------------------------- > > > hrStorageSize extract from HOST-RESOURCES-MIB > > hrStorageSize OBJECT-TYPE > SYNTAX Integer32 (0..2147483647) > MAX-ACCESS read-write > STATUS current > DESCRIPTION > "The size of the storage represented by this entry, in > units of hrStorageAllocationUnits. This object is > writable to allow remote configuration of the size of > the storage area in those cases where such an > operation makes sense and is possible on the > underlying system. For example, the amount of main > memory allocated to a buffer pool might be modified or > the amount of disk space allocated to virtual memory > might be modified." > ::= { hrStorageEntry 5 } > > From dmesg: > real memory = 17179869184 (16384 MB) > > sysctl -a | grep physmem > hw.physmem: 17063673856 > > The value for "hrStorageSize 1 Integer 2319048" should actually > be something like 4194304 (ie. 16G/4096) > > Also, the value keeps changing as memory use changes, which is > actually the job for hrStorageUsed not hrStorageSize. > > We installed net-snmp on one of the boxes, and even though we have no > confidence in net-snmp, it does appear to return the correct values > for hrStorageSize. > > Looks like a bug somewhere in usr.sbin/bsnmpd/modules/snmp_hostres/ > but I've only had a quick look and can't quite follow what is going on. > > Makes this part of the table fairly useless for monitoring.hrStorageSize "Real Memory Metrics" shows the value from sysctl vm.vmtotal, i.e. "total real memory in use" (whatever it means). What you want (hw.physmem) is available as HOST-RESOURCES-MIB::hrMemorySize.0. -- Mikolaj Golub