Snmp client-side tools
First versions of the snmp client tools (snmpget, snmpset and snmpwalk) have been checked into the Perforce code repository. There's a lot more work to be done though :
- Finish snmp client tools implementations (adding a daemon receiving traps will be nice here, but that might have to wait until some other work gets done)
Ethernet MIB - see what's wrong with the drivers actually deliver the statistics and add what's new in the latest EtherLike-MIB RFC
- IPFilter module
A new version of bsnmptools(bsnmpwalk, bsnmpget, bsnmpset) installing separately from the rest of the bsnmp code is available at http://www.ringlet.net/~shteryana/snmp/bsnmptools-20060818-01.tar. The up-to-date sources are currently in FreeBSD perforce code repository under //depot/user/soc-shteryana/bsnmp/. Tarball of perforce sources is available at http://www.ringlet.net/~shteryana/snmp/bsnmp_p4-20060819-01.tar.
How to install
tar -xvf bsnmptools-20100516-01.tar
make install (as root)
How to use
Each of the tools installs with a man page that describes the options that can be provided to the bsnmptools and how to use them. Since bsnmptools read OID<->Human-Readable-OID-Name information from the files produced by gensnmpdef(1) (the ones used by bsnmpd(1) daemon and installed under /usr/share/snmp/defs), to be able to use the complete functionality of the bsnmptools, one needs an updated version of the files containing a bit more information. A tarball of the updated files is available at http://www.ringlet.net/~shteryana/snmp/snmp_defs-20060502-01.tar. A quick and dirty way to install the files is to un-tar the tarbal and copy all the files under /usr/share/snmp/defs/. After re-compiling bsnmp sources (e.g. as a part of build && installworld), the files will be overwritten though. These files should be enough to get a decent output when using the tools against bsnmpd(1) agent. If you want to use the tools against a different agent and still get a nice user-friendly ouput of the OIDs, you will have to produce your own .def files with gensnmpdef(1) for the MIBS your agent is serving. Currently gensnmpdef's sources are in CVS under src/contrib/bsnmp/gensnmpdef but gensnmpdef is not compiled/installed with the base system. To install it you need to install libsmi first - to install it from port do:
make install (as root)
Furthermore to produce files that contain all the information bsnmptools need to give a decent output you need to patch gensnmpdef - patch available at http://www.ringlet.net/~shteryana/snmp/gensnmpdef-20060503-03.diff. My Makefile to compile and install gensnmpdef (which I have under src/usr.sbin/bsnmpd/gensnmpdef) can be fetched from http://www.ringlet.net/~shteryana/snmp/Makefile. You can produce your own files with 'gensnmpdef MIB-FILE'.
- def files can contain include directives - when such directive is met bsnmptools look up the file to include under /usr/share/snmp/defs or /usr/local/share/snmp/defs - no option to change that default currently
- a big part of the code reading the files is copied from gensnmptree.c - it would be nice if that code is moved in the library to avoid duplication in libbsnmptools.
only a few textual conventions for Octetstrings are currently implemented - that is Dateandtime - for displaying Dates, Physaddress for displaying MAC addresses and a couple more. New ones can be easily added though. If you get some output like ifPhysAddress[Integer : 1] = Octetstring : ****** , maybe it's because the bsnmptools don't know how to print the octetstrings properly - drop me an e-mail at shteryana@FreeBSD.org and I'll probably implement it.
- no decent man page for libbsnmptools(3) present - I pasionately hate writing anything different from code, especially documentation - that should explain why man page for libbsnmptools(3) has not been written yet.
- there are probably some bugs left.
Three new textual conventions implemented - Macaddress(SNMPv2-TC), Bridgeid (BRIDGE-MIB), Bridgeportd (BEGEMOT-BRIDGE-MIB).
Major cleanup of code - style(9)-ify, removed duplicate code, merge the three tools' main files/routines in a single. Successfully parse OIDs with a leading . like in .1.3.6, and textual OIDs with a leading dot as in .iso.org.dod (net-snmp style).
Fix a problem with bsnmpwalk looping forever when "End of Mib View" responce is received. Reported by: keramida@
Display InetAddress textual convention or at least the IPv4/IPv6 address types.
Add partial support for BITS type to the bsnmptools - now BITS type is printed/specified via hex number (up to 8 octets). TODO - actually print which bitsare set in an object of type BITS via their textual representation. Fix a crash when the indexes of a table include an object of type ENUM or BITS. Sources available in Perforce (under //depot/user/syrinx/bsnmp/usr.sbin/bsnmpd/tools/) and on Freefall (http://people.freebsd.org/~syrinx/snmp/bsnmptools-20100516-01.tar)