From owner-freebsd-questions@FreeBSD.ORG Sun Nov 23 18:00:42 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20EAD16A4D7 for ; Sun, 23 Nov 2003 18:00:42 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A74443FF7 for ; Sun, 23 Nov 2003 18:00:07 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id hAO206vK008802; Sun, 23 Nov 2003 20:00:06 -0600 (CST) (envelope-from dan) Date: Sun, 23 Nov 2003 20:00:06 -0600 From: Dan Nelson To: paul beard Message-ID: <20031124020006.GI2146@dan.emsphone.com> References: <8FF2C6A7-1DFB-11D8-B52A-000A95BBCCF8@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8FF2C6A7-1DFB-11D8-B52A-000A95BBCCF8@mac.com> X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i cc: questions@freebsd.org Subject: Re: POLA violation?: snmp renumbering stuff X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2003 02:00:42 -0000 In the last episode (Nov 23), paul beard said: > For some reason, my locally installed snmp daemons decided to > renumber the elements in the hrStorageTable, meaning all the attached > disks were being either misreported or just plain dropped from my > graphs (paulbeard.no-ip.org/mrtg/blue/index.html). Not that the new > numbering doesn't make sense but I didn't know this was going to > happen. > > How to discover and fix it? snmptable is my friend. As shown here, > the memory used by the kernel is listed first, followed by the disks. > The disks were numbered starting at 1 before . . . . . I don't think snmp tables have any defined order. I don't even know if the index for a particular resource is guaranteed to be stable across filesystem dismount/remounts. Something like this should work: snmptable -Cf : blue hrStorageTable | grep :/var: | awk -F : '{print $4 * $5}' I use something similar in a script to graph disk usage in mrtg. It sould be really nice if snmptable had a built-in flag to print a particular cell from a table, though. -- Dan Nelson dnelson@allantgroup.com