From owner-freebsd-stable@FreeBSD.ORG Sun Mar 23 15:43:52 2014 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27019877 for ; Sun, 23 Mar 2014 15:43:52 +0000 (UTC) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 927157C5 for ; Sun, 23 Mar 2014 15:43:51 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id e16so3016179lan.30 for ; Sun, 23 Mar 2014 08:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=gh6NId0spsV0XUcUoKx79t/9/MHE6wQ79Iro7nEXTDc=; b=dmgvtVUB4m0NfxTfiCxtJv8AEMYuj68v9D/B/cH9YRx25Ztz72wNKEVT2qqyhtt75j VFkJVoZQVKMSso9OFhq+qhRZLXZbxCdkbiVvIlFBDvsh/ohs9tGoapJgoWCuJZlHYvEB vwxpSUtzJyKkf1o1qCyZ57HcCkVdOa5OQq+j1pugqHVYiY08KqZdZqPMjqocR+nl2uyQ SMQoKYX2uYIHOk9IUJ4JNa63keMEYB+rANNl5ugeskgMPt3Ry3MKpynh9VNxbWHyObi/ Y4+OCocRqbcyG741ovdhyVI1RSJSfDh750vHQAKuV6MST1Vrkjuf5H2usshzD8MVuEnS eb/g== X-Received: by 10.112.39.97 with SMTP id o1mr1499131lbk.38.1395589429667; Sun, 23 Mar 2014 08:43:49 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id u4sm10870922laj.2.2014.03.23.08.43.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Mar 2014 08:43:48 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 23 Mar 2014 17:43:46 +0200 From: Mikolaj Golub To: Paul Koch Subject: Re: bsnmp HOST-RESOURCES.hrStorageSize odd value for real memory metrics Message-ID: <20140323154344.GA4009@gmail.com> References: <20140318144119.6b623341@speedy.akips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140318144119.6b623341@speedy.akips.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 15:43:52 -0000 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