TUT:Configuring Net-SNMP Applications

From Net-SNMP Wiki
Revision as of 21:43, 17 June 2010 by Wes (Talk | contribs) (first cut)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

All of the Net-SNMP applications use similar configuration file structures.

Include File

Requires Net-SNMP 5.6

Note: Features discussed on this page require Net-SNMP version 5.6 or higher.

You can include other files from within .conf files. Such as:

 # $HOME/.snmp/snmp.conf:
 include another.conf

Host Specific Configuration Files

Requires Net-SNMP 5.6

Note: Features discussed on this page require Net-SNMP version 5.6 or higher.

Host specific configuration files are also possible in order to set specific variables that are intended only for certain hosts. For example, if you you have a $HOME/.snmp/hosts/host1.example.com.conf file that contains:

 16bitIDs true

Then when you run snmpget or any other application it will refrain from using 32bit messageIDs (a SNMP bug that exists in certain devices).

This is especially powerful when combined with the include statement:

 # $HOME/.snmp/snmp.conf:
 defVersion 3
 defSecurityLevel authPriv
 # ...
 # $HOME/.snmp/hosts/router.conf:
 include insecure.conf
 # $HOME/.snmp/insecure.conf:
 # this file overrides the default access settings in the snmp.conf file for our lame servers that don't support SNMPv3
 defVersion 1
 defCommunity public

Internals

TBD: Describe how init_snmp("appname") triggers reading of appname.conf files