Snmp client-side tools
03/09/2005
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
Update 07-05-2006
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
fetch http://www.ringlet.net/~shteryana/snmp/bsnmptools-20060818-01.tar
tar -xvf bsnmptools-20060818-01.tar
cd bsnmptools
make
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:
cd /usr/ports/net-mgmt/libsmi
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'.
Known Issues
- 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.
Enjoy
Update 19-08-2006
Three new textual conventions implemented - Macaddress(SNMPv2-TC), Bridgeid (BRIDGE-MIB), Bridgeportd (BEGEMOT-BRIDGE-MIB).