~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to man/snmp_config.5.def

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

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