Linux CMU SNMP Project
Jürgen
Schönwälder,
Erik Schönfelder
This is the documentation for the eighth release of the CMU SNMP port
to Linux. This port supports SNMP
version 1 (SNMPv1) and SNMP version 2 (SNMPv2). It includes a
bilingual SNMPv1/SNMPv2 agent and several simple command-line
management tools. This release is based on the CMU SNMP release with
USEC support. It does not implement the historic party based
administrative model of SNMPv2.
Where can I download the software?
The source and binary distributions are named
and available from ftp.ibr.cs.tu-bs.de (134.169.34.15) in
/pub/local/linux-cmu-snmp. The distribution is also available from
sunsite.unc.edu in /pub/Linux/system/Network/admin.
This release has been tested with Linux v2.0 and libc
v5.2.18 (therefore it is ELF based) and may or may not work
with older kernels and libc's. It will work with Linux v2.1.
What's new?
As in previous releases, a hand-full of bugs are fixed and for
developers additional support is included.
If you are running version 3.3 or earlier, you should upgrade to
version 3.4.
Which MIB modules are supported?
The current release supports the following MIB modules:
The Linux MIB is experimental. Please contact
<schoenw@cs.utwente.nl>
is you have suggestions for additional Linux specific MIB variables.
What is SNMP at all?
SNMP is the Simple Network Management Protocol of the Internet. The
first version of this protocol (SNMPv1) is a full Internet standard
and defined in RFC 1155 and RFC 1157. The second version of SNMP
(SNMPv2) is defined in RFC 1901 - RFC 1908 and is currently a draft
Internet standard.
The protocol allows to retrieve and set variables, addressed as
objects in a Management Information Base (MIB). The well-known
standard MIB is called MIB-2 and defined in RFC 1213. It contains
variables related to the TCP/IP protocol suite. Many additional MIB
modules are defined (and sometimes implemented...) by IETF working
groups. These modules together with some vendor specific MIB modules
allow to monitor and operate equipments like Unix-Hosts, X-Terminals,
Printers, Routers, coffee machines, toasters and more.
Access to the MIB is implemented by an SNMP agent. It listens on a
well-known UDP port for SNMP requests send by a management station,
gets the requested information out of the operating system, and
returns a response. A management station can range from a simple
command-line tool as contained in this CMU port (e.g. snmpget or
snmpwalk) to a complex powerful graphical management station.
The security model of SNMPv2 is still under development and the
currently implemented SNMPv2 USEC model is likely to change in
a future version.
Where can I find more information related to SNMP?
There are several online resources where you can learn more about
SNMP. The following list of URLs points to the some important starting
points.
Are there other nice SNMP tools around?
There are many SNMP tools around. A widely used package is the scotty
network management toolkit:
http://www.cs.utwente.nl/~schoenw/scotty/
Scotty includes an extension for the Tool Command Language
(Tcl) called Tnm which allows to write SNMPv1/SNMPv2 scripts in
Tcl. A number of example scripts are included to demonstrate the power
of the Tcl API. The Scotty package also contains Tkined, a graphical
network management station based on Tk/Tcl.
People who prefer the Perl language
should look at:
ftp://ftp.wellfleet.com/netman/snmp/perl5/SNMP.tar.gz
This is a Perl 5 extension module that provides an OO interface to the
CMU toolkit library.
How to install?
Binary Quick Install:
- Be sure, you have ELF support installed (ELF libc, ELF
kernel support).
- Extract binaries, manpages and add-on's by running:
rm /usr/sbin/snmpd /lib/libsnmp.so
cd / ; tar xvzf .../cmu-snmp-linux-3.4-bin.tar.gz
- If you install v3.4 the first time, do
cd tmp/cmu-snmp-linux-3.4/etc
./installconf -mini <password>
- Have a look at /etc/snmpd.conf to be familiar with it
and create an entry in /etc/rc.local:
/usr/sbin/snmpd -f ; echo 'snmpd'
This launches the agent (running in background).
- A quick test would be (after launching the agent):
snmpwalk localhost public system
Source Quick Install:
- Extract the source by running:
tar xvzf .../cmu-snmp-linux-3.4-src.tar.gz
cd cmu-snmp-linux-3.4 ; ./configure ; make
- Switch to root and run
make install
- If you install v3.4 the first time, do
cd ./etc
./installconf -mini <password>
- Have a look at /etc/snmpd.conf to be familiar with it
and create an entry in /etc/rc.local:
/usr/sbin/snmpd -f ; echo 'snmpd'
This launches the agent (running in background).
- A quick test would be (after launching the agent):
snmpwalk localhost public system
Installed files:
The default installation includes the following list of files:
- /lib/libsnmp.so.3.4
- /usr/sbin/snmpd
- /usr/bin/snmptrapd
- /usr/bin/snmpget
- /usr/bin/snmpgetnext
- /usr/bin/snmpset
- /usr/bin/snmpwalk
- /usr/bin/snmptest
- /usr/bin/snmpnetstat
- /usr/bin/snmptrap
- /usr/lib/mib.txt
- /etc/snmpd.conf (if not already installed)
- /etc/snmpd.agentinfo (if not already installed)
- /usr/man/man8/snmpd.8
- /usr/man/man8/snmptrapd.8
- /usr/man/man1/snmpget.1
- /usr/man/man1/snmpgetnext.1
- /usr/man/man1/snmpset.1
- /usr/man/man1/snmpwalk.1
- /usr/man/man1/snmptest.1
- /usr/man/man1/snmpnetstat.1
- /usr/man/man1/snmptrap.1
- /usr/man/man3/snmp_api.3
- /usr/man/man5/variables.5
- /usr/include/snmp/snmp.h
- /usr/include/snmp/snmp_impl.h
- /usr/include/snmp/asn1.h
- /usr/include/snmp/snmp_api.h
- /usr/include/snmp/parse.h
- /usr/include/snmp/snmp_client.h
How to launch snmpd?
To start ``snmpd'' at boottime, add a line to /etc/rc.local
containing:
/usr/sbin/snmpd -f ; echo 'starting snmpd'
The -f option forces snmpd to fork a background demon and to
return.
To start ``snmptrapd'' at boottime, add a line to /etc/rc.local
containing:
/usr/sbin/snmptrapd -v 1 -s >/dev/null 2>&1 &
(option -v 1 for V1 auth and -s for syslog-option) You should start
snmptrapd before the snmpd, if the coldStart trap of snmpd is sent to
this host. :-)
If you are running another trapsink (e.g. if you are using
tkined/scotty), you should not run snmptrapd -- as a rule of thumb: if
you don't know, there's no need to run snmptrapd.
If you are running a CD-based Linux-system (/usr/lib mounted readonly
from CD), you may copy mib.txt to /etc and it will be used instead.
Configuring the SNMP agent:
A sample snmpd.conf file for the agent will be installed in /etc, if
/etc/snmpd.conf is not present. You may want to run
etc/installconf [-mini|...] <password>
to install a config other than the sample USEC configuration.
Additional parameters are set-able in /etc/snmpd.conf with
this linux port:
- the udp port the agent is listening (also set-able
on the command line),
- the sysContact, sysLocation and sysName,
- the trapsink and snmpEnableAuthenTraps,
- interface speed parameters suitable for your system
(do you have a atm-card in your linux box ? -- set the speed !)
What has changed in the last releases?
- Version 3.4 released.
- snmplib/mib.[ch]: snmp_new_prefix() introduced to allow change
of the oid-prefix. Patch by Phil Wood .
- configure.in,{,apps/}Makefile.in: added --with-noagent configure
target. This should allow compilation on SunOS (configure
--with-liba) and Solaris (configure --with-liba --with-noagent).
- apps/snmp_util.c: added `fd_add (filedes, handler)' to allow
easier adding of filedescriptors and callback functions to the
main select loop.
- snmplib/asn1.[ch]: introduced {u_,}int32 type to fix problems
with 64bit alpha architecture. Thanks to Andrew Whyte
.
- apps/hr_vars.c: added changed /proc/meminfo layout (since
v2.1.41) to hr_getstor(); old v2.0.x layout is still valid.
- apps/snmpd.c: cleanups from old community code; the communities
list was clobbered by old code. This fixes a bug where it was
occasionally possible to set a variable without permission.
- apps/snmp_util.[ch] added various utility functions provided
by Olivier Montanuy .
- apps/snmp_util.[ch] added with code to support activities at
intervals (eg. for the calculation of hrProcessorLoad).
- agent, apps: fixes for the alpha platform, mainly
replacement of int by ssize_t. Patch by Erik J. Verbruggen
.
- snmplib/parse.c: The parser nuked on long comment lines, so
MAXTOKEN size increased to 1024. Report and quick-fix by Olivier
Montanuy .
- snmplib/snmp_api.c: Initialization of defaults in snmp_open()
moved, to prevent error within snmp_close() which cleans this
initialization up. Fix by Juergen and reported by XXX ??>.
[schoenfr: cleaned up this fix, because it broke v2 processing.]
- snmplib/snmp_api.c: ASN1 encoding of a trap-message in
snmp_build() fixed, now snmptrap(1) should send correct
encoded messages. Patch provided by Juergen and problem reported
by David Livingstone .
- snmplib/snmp_client.c: clone_variable() introduced ``as an attempt
to fix a problem with some illegal variable pointers (address =
0x27 !). The bug seems fixed, but it's so rare that I'm not
totally sure.'' - comment, code and fix by Olivier Montanuy
- snmplib/snmp_api.c: added snmp_print_packet() and
free_one_request() fixing an annoying bug removing a request;
code and fix by Olivier Montanuy
- snmplib/snmp_api.h: default initial timeout reduced from 0.5 to 0.3
sec, default retries raised from 4 to 6. This should improve
communication over slow lines especially with notable packet-loss.
overall timeout is therefore raised from ~7.5 sec to ~19 sec.
- apps/snmp_vars.c: since linux v2.1.15 /proc/net/dev shows up byte
counter, so the agent can report correct ifInOctets and
ifOutOctets (if running on a newer kernel).
- apps/snmpget.c, man/snmpget.1: added timeout and retry parameter;
same for snmpwalk. snmplib/snmp_api.[ch]: default timeout and
retry define moved to the header.
- snmplib/snmp_client.c: avoid crash due to use of freed memory;
fix by Olivier Montanuy .
- snmplib/parse.c: small fix running endless reading eof while
looking for `;'.
- */*.h: started adding prototypes for exported functions,
added neccessary includes, cleaned up unnecessary
defines/includes.
- Version 3.3 released.
- snmpd.conf, snmpd.c: renamed configuration keyword `system
contact' to `sysContact', `system location' to `sysLocation and
`authentraps' to `snmpEnableAuthenTraps' with change of value
`yes' to `enabled'.
- snmp_agent.c: v2 to v1 error code-mapping added. inconsistent
name case added (but it is not used).
- created mib_module.[ch] and mib_example.c
- configure.in updated to autoconf v2.12
- ident mib moved to ident_vars.[ch]; mib_register() introduced
and changed the subtrees array to a linked list
- split of snmp_vars.[ch] in snmp_vars.[ch], hr_vars.[ch] and
linux_vars.[ch]; hr_processor_load.[ch] merged into hr_vars.[ch].
- added wildcard match to interface names in snmpd.conf; eg. isdn*
matches all isdn interfaces.
- in route_write.c get/del route disabled
- added in snmp_vars.c interfaces numbers > 9 (e.g. ppp10)
- hrSystemInitialLoadParameters implemented;
patch by Juergen Schoenwaelder <schoenw@cs.utwente.nl>
- installation of parse.h snmp_client.h added, creation of
link libsnmp.so added, nstat added, sample snmpd.conf now
has per default a commented private entry;
patch from David Engel <david@elo.ods.com>
- introduced @sbindir@ in Makefile.in;
patch by Ambrose Li <acli@mingpaoxpress.com>
- version 3.2 released
- fixed implementation of hrProcessorLoad;
patch by Patrick Weemeeuw <patrick.weemeeuw@kulnet.kuleuven.ac.be>
- version 3.1 released
- sysUptime changed to agent-uptime (not system uptime)
- mib.txt expanded by ident,host-mib; some system group
objects added; `mib' renamed to `mib-2'
- many fixes from cmu-snmp2.1.2-l4 are incorporated, but
some are still missing
- switched to cmusnmp-1.1b+v2usec; the linux port is now named
cmu-snmp-linux-3.1
Are there any known bugs?
- `snmpwalk localhost /xx/yy/zz' dumps core.
- snmptrap sends the uptime of the system and not sysUpTime of the agent.
- add nfs-mounted volumes to hrFSRemoteMountPoint.
- still for hardware-addresses only ethernet is assumed.
- try to integrate aliased interfaces; eg. eth0:0
- manpages/docs: aeh, umm - beam me up.
Who wrote all the code?
Several people have contributed code to this project. The list below
is a starting point to give credits. Let us know if you know additional
names that should be listed below.
- Steve Waldbusser
started the CMU SNMP project when SNMP was born.
-
Glenn Waters
implemented SNMPv2 USEC on top of the CMU package.
-
Jürgen Schönwälder
has born the idea to port the CMU code to Linux.
-
Erik Schönfelder
wrote most of the Linux specific code.
-
David Engel
provided several bug fixes and valuable suggestions.
-
Patrick Weemeeuw
provided patches for the Host Resource MIB.
-
Olivier Montanuy
provided several bugfixes for the snmplib and the agent and provided
new code.
This page was last updated on 24. July 1997