snmp_config


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 be
       found and read from.  By default, the applications look for  configura-
       tion  files  in  the  following  4  directories,  in  order: /etc/snmp,
       /usr/share/snmp,  /usr/lib/i386-linux-gnu/snmp,  and  $HOME/.snmp.   In
       each  of  these  directories,  it looks for files with the extension of
       both conf and local.conf (reading the second ones last).  In this  man-
       ner,  there are 8 default places a configuration file can exist for any
       given configuration file type.

       Additionally, the above default search path can be overridden  by  set-
       ting the environment variable SNMPCONFPATH to a colon-separated list of
       directories to search for.  The path for the persistent data should  be
       included when running applications that use persistent storage, such as
       snmpd.

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

              file in SNMP_PERSISTENT_FILE environment variable
              directories in SNMPCONFPATH environment variable
              directory defined by persistentDir snmp.conf variable
              directory in SNMP_PERSISTENT_DIR environment variable
              default /var/lib/snmp directory

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

              file in SNMP_PERSISTENT_FILE environment variable
              directory defined by persistentDir snmp.conf variable
              directory in SNMP_PERSISTENT_DIR environment variable
              default /var/lib/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 will con-
       figure 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  applica-
       tions  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.
       Normally  to enable packet dumping in the configuration file you'd need
       to put a line like:

              dumpPacket true

       into the snmp.conf file.  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 daemon.  However, you need to
       tell  the parser to expect this line.  You do this by putting a special
       type specification token inside a [] set.  In other words, inside  your
       snmpd.conf file you could put the above snmp.conf directive by adding a
       line like so:

              [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

       The same approach can be used to set  configuration  directives  for  a
       particular client application (or group of applications).  For example,
       any program that uses the 'snmp_parse_args()' call to  handle  command-
       line  arguments  (including  the standard command-line tools shipped as
       part of the Net-SNMP distributions) will automatically read the  config
       file  'snmpapp.conf'.  To set library-level settings for these applica-
       tions (but not other more-specific tools), use  configuration  such  as
       the following:

              [snmp] defCommunity myCommunity

       for a single directive, or

              # make this file handle snmp.conf tokens:
              [snmp]
              defCommunity myCommunity
              defVersion   2c
              # return to our original snmpapp.conf tokens:
              [snmpapp]

       for  multiple  settings.  Similarly for any other application token (as
       passed to init_snmp()).

COMMENTS
       Any lines beginning with the character '#' in the  configuration  files
       it will be appended. That is, all configuration files must end
       in '.conf'.

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

SEE ALSO
       snmpconf(1), netsnmp_config_api(3), snmp.conf(5), snmpd.conf(5)



V5.7.2                            08 Mar 2010                   SNMP_CONFIG(5)
Man Pages Copyright Respective Owners. Site Copyright (C) 1994 - 2017 Hurricane Electric. All Rights Reserved.