This patch against Net-SNMP SVN trunk revision 20111 adds a trio of boolean configuration directives:
diskio_exclude_fd yes => Exclude from diskIOTable all devices whose names start with "fd"
diskio_exclude_loop => Exclude from diskIOTable all devices whose names start with "loop"
diskio_exclude_ram => Exclude from diskIOTable all devices whose names start with "ram"
The patch affects only Linux systems, and is aimed at enabling configurable trimming (off by default) of commonly encountered cruft from the diskIOTable: unwanted stats, usually all zeroes, from block devices that the majority of sysadmins don't even think of as existing. Specifically: floppy disks (fd*), loopback-mounted files (loop*), and ramdisks (ram*).
A quick sampling of a few Linux systems in our environment shows how much of this cruft there is in the default configurations of various GNU/Linux distributions:
CentOS 5.5: 16 ramdisks, 8 loopback devices
Ubuntu 8.04 LTS: 16 ramdisks
Ubuntu 10.10: 16 ramdisks, 8 loopback devices
Debian GNU/Linux 5.0 (lenny): 16 ramdisks, 8 loopback devices
I've tested the patch with success on the following Linux systems:
Centos 5.5 32-bit: Linux nen 2.6.18-194.32.1.el5.centos.plus #1 SMP Wed Jan 5 18:14:09 EST 2011 i686 i686 i386 GNU/Linux
Ubuntu 8.04 64-bit: Linux mrscrabtree 2.6.24-25-generic #1 SMP Tue Oct 20 06:49:12 UTC 2009 x86_64 GNU/Linux
Since the entirety of the patch is #ifdef-ed out on non-Linux platforms, there should be no net effect on other platforms. I attempted to build the same sources on a Solaris 10 system in order to verify no regressions, but libtool is giving me problems whose solutions I don't have time to track down.
The patch also includes documentation of the feature in the form of additions to the snmpd(5) man page sources.
Patch enabling configurable exclusion of ram, loop, fd devices in diskIO
I just got a build of the patched sources to complete on Solaris 10. Ran the agent with and without the new configuration directives and noted no effect on the diskIOTable, as expected.
SVN revision 20181
Note that the implementation is slightly different (using the 'default_store' flag mechanism), for compatibility with other boolean config tokens. But the functionality is the same
Thanks for the patch! It has been applied to the 5.6.x (and later) code branch and the main development tree, and will appear in future releases of the Net-SNMP package.