From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 19 15:09:04 2013 Return-Path: Delivered-To: freebsd-hackers@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 ESMTP id E810D695 for ; Thu, 19 Sep 2013 15:09:03 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADD29247F for ; Thu, 19 Sep 2013 15:09:03 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [172.17.17.101]) by email2.allantgroup.com (8.14.5/8.14.5) with ESMTP id r8JF8tsC033552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Sep 2013 10:08:55 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.7/8.14.6) with ESMTP id r8JF8tF8072748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Sep 2013 10:08:55 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.7/8.14.7/Submit) id r8JF8sg2072747; Thu, 19 Sep 2013 10:08:54 -0500 (CDT) (envelope-from dan) Date: Thu, 19 Sep 2013 10:08:54 -0500 From: Dan Nelson To: Mark Saad Subject: Re: FreeBSD SNMP OID Question Message-ID: <20130919150854.GC97298@dan.emsphone.com> References: <20130917181101.GB97298@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.1-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.8 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (email2.allantgroup.com [172.17.19.78]); Thu, 19 Sep 2013 10:08:55 -0500 (CDT) X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on email2.allantgroup.com X-Scanned-By: MIMEDefang 2.73 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2013 15:09:04 -0000 In the last episode (Sep 18), Mark Saad said: > On Tue, Sep 17, 2013 at 2:11 PM, Dan Nelson wrote: > > In the last episode (Sep 17), Mark Saad said: > > > Can someone shed some light on a OID mystery I have. I am using > > > cacti to trend some snmp data off a bunch of FreeBSD servers. > > > > > > I noticed someone added a graph to a cluster for UCDavis - ssRawSwapIn / > > > UCDavis - ssRawSwapOut . The OIDs are .1.3.6.1.4.1.2021.11.62 / > > > .1.3.6.1.4.1.2021.11.63 Their description is Number of blocks swapped > > > in / Number of blocks swapped out . > > > > > # snmpwalk -c MyPassword -v2c -Of server00 .1.3.6.1.4.1.2021.11.62.0 > > > .iso.org.dod.internet.private.enterprises.ucdavis.systemStats.ssRawSwapIn.0 = Counter32: 3588 > > > > That's a counter, so it's reporting the total number of pageins since > > boot (or since snmp started, depending on the particular value you're > > fetching). Cacti should be able to poll that OID and graph the > > difference over time to show pageins/sec. > > I guess to better refine the question , what is raw swap vs the sysctl > vm.stats.vm.v_swappgs{out/in} . I see that net-snmpd has ssSwapOut and > ssRawSwapOut . where raw is the current value and "cooked" > (ssswap{out/in}) is the average value . I am just at a loss when I am > trying to debug this graph issue as the "cooked" oid returns negative ints > and the raw returns positive ints, but the sysctrls and top show no usage > ? > > Has anyone seen this before ? I don't know. I would have expected that ssRawSwapIn and ssRawSwapOut would have mapped directly to the sysctls vm.stats.vm.v_swappgsout vm.stats.vm.v_swappgsin, but apparently they don't. It's probably a bug in net-snmp; the vm stats code is pretty hairy due to having to support every version of every Unix out there, and no standard API for fetching stats like this. The values don't match on any of my systems, either. $ sysctl vm.stats.vm | grep swappgs vm.stats.vm.v_swappgsout: 1088669 vm.stats.vm.v_swappgsin: 85576 $ snmpget localhost ssRawSwapOut.0 ssRawSwapIn.0 enterprises.ucdavis.systemStats.ssRawSwapOut.0 = Counter32: 115135 enterprises.ucdavis.systemStats.ssRawSwapIn.0 = Counter32: 5671 -- Dan Nelson dnelson@allantgroup.com