Configuration file types, Switching configuration files in mid-file – Cisco Cisco Access Registrar 3.5 User Manual

Page 52

Advertising
background image

5-6

Cisco Access Registrar 3.5 Concepts and Reference Guide

OL-2683-02

Chapter 5 Understanding SNMP

SNMP Traps

These files are optional and are only used to configure the extensible portions of the agent, the values of
the community strings, and the optional trap destinations. By default, the first community string
(“public” by default) is allowed read-only access and the second (“private” by default) is allowed write
access, as well. The third to fifth community strings are also read-only.

Additionally, the above default search path can be over-ridden by setting the environmental variable
SNMPCONFPATH to a colon-separated list of directories to search.

Finally, applications that store persistent data will also look for configuration files in the /var/snmp
directory.

Configuration File Types

Each application may use multiple configuration files which will configure various different aspects of
the application. For instance, the SNMP agent (snmpd) knows how to understand configuration
directives 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 '-H' switch on the command line
that will list the configuration files it will 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 for controlling the fundamental nature of all of the SNMP
applications, such as how they all manipulate and parse the textual SNMP MIB files.

Switching Configuration Files in Mid-File

It's possible to switch in mid-file the configuration type that the parser is supposed to be reading. Since
that output for the agent by default, but you didn't want to do that for the rest of the applications (for
example, snmpget and snmpwalk, you would need to put a line like the following into the snmp.conf
file.

dumpPacket true

But, this would turn it on for all of the applications. So, instead, you can put the same line in the
snmpd.conf file so that it only applies to the snmpd demon. However, you need to tell the parser to expect
this line. You do this by putting a special type specification token inside a square bracket ([ ]) set. In
other words, inside your snmpd.conf file you could put the above snmp.conf directive by adding a line
like the following:

[

snmp] dumpPacket true

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

# make this file handle snmp.conf tokens:

[snmp]

dumpPacket true

logTimestamp true

# return to our original snmpd.conf tokens:

[snmpd]

rocommunity mypublic

Advertising