SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Trustix net-snmp-5.4-2tr.i586.rpm

SNMP.CONF

Section: Net-SNMP (5)
Updated: 5 May 2005
Index 

NAME

snmp_config - handling of Net-SNMP configuration files 

DESCRIPTION

The Net-SNMP package uses various configuration files to configure its applications. This manual page merely describes the overall nature of them, so that the other manual pages don't have to. 

DIRECTORIES SEARCHED

First off, there are numerous places that configuration files can befound and read from. By default, the applications look forconfiguration files in the following 4 directories, in order:/etc/snmp,/usr/share/snmp, /usr/lib/snmp, and $HOME/.snmp. In each of thesedirectories, it looks for files with the extension of bothconf and local.conf(reading the second ones last). In this manner, there are8 default places a configuration file can exist for any givenconfiguration file type.

Additionally, the above default search path can be overridden bysetting the environment variable SNMPCONFPATH to a colon-separatedlist of directories to search for. The path for the persistentdata should be included when running applications that usepersistent storage, such as snmpd.

Applications will read persistent configuration files in the following order of preference:

file in SNMP_PERSISTENT_FILEenvironment variable

directories in SNMPCONFPATHenvironment variable

directory defined by persistentDir snmp.conf variable

directory in SNMP_PERSISTENT_DIR environment variable

default /var/net-snmp directory

Finally, applications will write persistent configuration files in the following order of preference:

file in SNMP_PERSISTENT_FILEenvironment variable

directory defined by persistentDir snmp.conf variable

directory in SNMP_PERSISTENT_DIR environment variable

default /var/net-snmp directory

Note: When using SNMP_PERSISTENT_FILE, the filename should match the application name. For example, /var/net-snmp/snmpd.conf. 

CONFIGURATION FILE TYPES

Each application may use multiple configuration files, which willconfigure various different aspects of the application. For instance, the SNMP agent(snmpd)knows how to understand configurationdirectives in both the snmpd.conf and the snmp.conf files. In fact,most applications understand how to read the contents of the snmp.conf files. Note, however, that configuration directives understood in one file may not be understood in another file. For further information,read the associated manual page with each configuration file type.Also, most of the applications support a -Hswitch on the command line that will list the configuration files itwill look for and the directives in each one that it understands.

The snmp.conf configuration file is intended to be a application suite wide configuration file that supports directives that are useful forcontrolling the fundamental nature of all of the SNMP applications,such as how they all manipulate and parse the textual SNMP MIB files. 

SWITCHING CONFIGURATION TYPES IN MID-FILE

It's possible to switch in mid-file the configuration type that theparser is supposed to be reading. Since that sentence doesn't makemuch sense, lets give you an example: say that you wanted to turn onpacket dumping output for the agent by default, but you didn't want todo that for the rest of the applications (ie, snmpget, snmpwalk, ...).Normally to enable packet dumping in the configuration fileyou'd need to put a line like:

dumpPacket true

into the snmp.conf file. But, this would turn it on for all of theapplications. So, instead, you can put the same line in thesnmpd.conf file so that it only applies to the snmpd daemon. However,you need to tell the parser to expect this line. You do this byputting a special type specification token inside a [] set. In otherwords, inside your snmpd.conf file you could put the above snmp.confdirective by adding a line like so:

[snmp] dumpPacket true

This tells the parser to parse the above line as if it were inside asnmp.conf file instead of an snmpd.conf file. If you want to parse abunch of lines rather than just one then you can make the contextswitch apply to the remainder of the file or until the next contextswitch directive by putting the special token on a line by itself:

# make this file handle snmp.conf tokens:[snmp]dumpPacket truelogTimestamp true# return to our original snmpd.conf tokens:[snmpd]rocommunity mypublic
 

COMMENTS

Any lines beginning with the character '#' in the configuration filesare treated as a comment and are not parsed. 

API INTERFACE

Information about writing C code that makes use of this system ineither the agent's MIB modules or in applications can be found in theread_config(3)manual page. 

SEE ALSO

read_config(3).


 

Index

NAME
DESCRIPTION
DIRECTORIES SEARCHED
CONFIGURATION FILE TYPES
SWITCHING CONFIGURATION TYPES IN MID-FILE
COMMENTS
API INTERFACE
SEE ALSO

This document was created byman2html,using the manual pages.