2.3 Installing SNMP Tools

In order to make use of the management capabilities available from SNMP, you will need a set of tools that can make SNMP queries. At a minimum these tools will need to allow you to:

  • Query a variable and view the response

  • Set a variable and determine if it was successful

  • Query entire tables with get- next -request

  • Receive traps

It would also be beneficial if the tools could perform more advanced tasks , such as retrieving data from the interfaces group and presenting it in a clear format.

A widely used set of very good SNMP tools is the net-snmp package from the University of California at Davis. The project Web page is at http://www.net-snmp.org/. Until recently, these tools were called the ucd-snmp tools, and earlier versions still bear this name . Versions 4 and earlier are ucd-snmp; versions 5 and later are net-snmp.

The Web site for these tools has source distributions available, as well as binary distributions for some platforms. In particular, there are binary distributions available of version 5 for Linux and binary distributions of version 4 available for Linux, Solaris, HPUX, FreeBSD, Irix, and Windows. The most recent version is always available as a source distribution.

2.3.1 Building from Source

After the source distribution is downloaded, it must be uncompressed and extracted from the tar archive. This can be done as:

 
 Solaris% gunzip -c net-snmp-5.0.8.tar.gz  tar xvf - 

or on a system with gnu tar it can be done as:

 
 Linux% gtar zxvf net-snmp-5.0.8.tar.gz 

Of course, the actual filename will depend on the version you have chosen to download. In this case, a directory will be created called net-snmp-5.0.8 . Change to that directory and type:

 
 Solaris% ./configure 

to configure net-snmp in preparation for building. After running for a while, it will ask you for input on several questions.

  • Default SNMP Version. First, it will want to know the default version of SNMP to use, for which you can answer 1, 2, or 3. The version can always be overridden on the command line, so your answer will not prevent you from using any functionality later on. The default answer is version 3. In the examples in this chapter, we always set the version explicitly on the command line.

  • System Contact Information. This will be the system contact returned for system.sysContact.0 if you decide to run the SNMP daemon from the package. It is often set to the email address of the administrator.

  • System Location. This will be the location returned for system.sysLocation.0 if you decide to run the SNMP daemon from the package. It should be set to the physical location of the device.

  • Logfile Location. This specifies the name of the file to which net-snmp will send logging information and error messages. The default answer is usually acceptable.

  • Snmpd Persistent Storage Location. This is the name of the directory where net-snmp will keep statefull configuration files. The default answer is again acceptable.

2.3.2 Build and Install

After configuration is complete, you can type:

 
 Solaris% make 

to build the entire package. If you want to install it on your system, login to a root account and type:

 
 Solaris# make install 

By default, this will install into the following directories in /usr/local/ :

  • bin/ : net-snmp applications

  • sbin/ : net-snmp daemons ( snmpd , snmptrapd )

  • share/snmp/ : net-snmp configuration data

  • share/snmp/mibs/ : MIB files

  • lib/ : net-snmp programming libraries

  • include/ : net-snmp programming includes

  • man/ : net-snmp man pages

If you wish to place these files somewhere other than in /usr/local , you must run the configure script with the --prefix option, as in:

 
 Solaris% ./configure --prefix=/usr/local/mydirectory 

and then run the make install .



Open Source Network Administration
Linux Kernel in a Nutshell (In a Nutshell (OReilly))
ISBN: 130462101
EAN: 2147483647
Year: 2002
Pages: 85

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net