Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2014 14:41:19 +1000
From:      Paul Koch <paul.koch137@gmail.com>
To:        stable@freebsd.org
Subject:   bsnmp HOST-RESOURCES.hrStorageSize odd value for real memory metrics
Message-ID:  <20140318144119.6b623341@speedy.akips.com>

next in thread | raw e-mail | index | archive | help
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-roo=
t1
hrStorageDescr 7 DisplayString /home, type: ufs, dev: /dev/gpt/simulator-ho=
me
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."
       ::=3D { hrStorageEntry 5 }

=46rom dmesg:
 real memory  =3D 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=20
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.
--=20
Paul Koch
Brisbane, Australia (+10 GMT/UTC)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140318144119.6b623341>