OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / ucd-snmp / original / man5 / snmp_config.5
1 .TH SNMP.CONF 5 "28 Aug 2001"
2 .ds )H U.C. Davis
3 .ds ]W V4.2.4
4 .UC 4
5 .SH NAME
6 snmp_config - describes how to configure the ucd-snmp applications.
7 .SH DESCRIPTION
8 The ucd-snmp package uses various configuration files to configure its 
9 applications.  This manual page merely describes the overall nature of 
10 them, so that the other manual pages don't have to.
11 .SH "DIRECTORIES SEARCHED"
12 First off, there are numerous places that configuration files can be
13 found and read from.  By default, the applications look for
14 configuration files in the following 3 directories, in order:
15 /usr/share/snmp, /usr/lib/snmp, and $HOME/.snmp.  In each of these
16 directories, it looks for files with the extension of both .conf
17 and .local.conf (reading the second on last).  In this manner, there are 6 
18 default places a configuration file can exist for any given
19 configuration file type.
20 .PP
21 Additionally, the above default search path can be overridden by
22 setting the environment variable SNMPCONFPATH to a ':' separated
23 list of directories to search for.
24 .PP
25 Finally, applications that store persistent data will also look in the 
26 /var/snmp directory for configuration files there.
27 .SH "CONFIGURATION FILE TYPES"
28 Each application may use multiple configuration files, which will
29 configure various different aspects of the application.  For instance, 
30 the SNMP agent (snmpd) knows how to understand configuration
31 directives in both the snmpd.conf and the snmp.conf files.  In fact,
32 most applications understand how to read the contents of the snmp.conf 
33 files.  Note, however, that configuration directives understood in one 
34 file may not be understood in another file.  For further information,
35 read the associated manual page with each configuration file type.
36 Also, most of the applications support a '-H' switch on the command
37 line that will list the configuration files it will look for and the
38 directives in each one that it understands.
39 .PP
40 The snmp.conf configuration file is intended to be a application suite 
41 wide configuration file that supports directives that are useful for
42 controlling the fundamental nature of all of the snmp applications,
43 such as how they all manipulate and parse the textual SNMP mib files.
44 .SH "SWITCHING CONFIGURATION TYPES IN MID-FILE"
45 It's possible to switch in mid-file the configuration type that the
46 parser is supposed to be reading.  Since that sentence doesn't make
47 much sense, lets give you an example: say that you wanted to turn on
48 packet dumping output for the agent by default, but you didn't want to
49 do that for the rest of the applications (ie, snmpget, snmpwalk, ...).
50 Normally to enable packet dumping in the configuration file
51 you'd need to put a line like:
52 .PP
53 .RS
54 dumpPacket true
55 .RE
56 .PP
57 into the snmp.conf file.  But, this would turn it on for all of the
58 applications.  So, instead, you can put the same line in the
59 snmpd.conf file so that it only applies to the snmpd demon.  However,
60 you need to tell the parser to expect this line.  You do this by
61 putting a special type specification token inside a [] set.  In other
62 words, inside your snmpd.conf file you could put the above snmp.conf
63 directive by adding a line like so:
64 .PP
65 .RS
66 [snmp] dumpPacket true
67 .RE
68 .PP
69 This tells the parser to parse the above line as if it were inside a
70 snmp.conf file instead of an snmpd.conf file.  If you want to parse a
71 bunch of lines rather than just one then you can make the context
72 switch apply to the remainder of the file or until the next context
73 switch directive by putting the special token on a line by itself:
74 .PP
75 .RS
76 .nf
77 # make this file handle snmp.conf tokens:
78 [snmp]
79 dumpPacket true
80 logTimestamp true
81 # return to our original snmpd.conf tokens:
82 [snmpd]
83 rocommunity mypublic
84 .RE
85 .SH COMMENTS
86 .PP
87 Any lines beginning with the character '#' in the configuration files
88 are treated as a comment and are not parsed.
89 .SH "API INTERFACE"
90 .PP
91 Information about writing C code that makes use of this system in
92 either the agent's mib modules or in applications can be found in the
93 read_config(3) manual page.
94 .SH "SEE ALSO"
95 read_config(3).
96 .\" Local Variables:
97 .\"  mode: nroff
98 .\" End: