8 Definition of Configuration File
All configuration data must be included in configuration files which are located in the configuration directory. The name of this directory is given to the
snmp_supervisor:start_master/2,3
function. These files are read at start-up, and are used to initialize the SNMPv2-MIB or STANDARD-MIB, OTP-SNMPEA-MIB, SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB (refer to the Management of the Agent for a description of these MIBs).The directory where the configuration files are found is given as a parameter to the agent.
The entry format in all files are Erlang terms, separated by a '.' and a newline. In the following sections, the formats of these terms are described. Comments may be specified as ordinary Erlang comments.
Syntax errors in these files are discovered and reported with the function
snmp_error:config_err/2
at start-up.8.1 Communities
This information should be stored in a file called
community.conf
.The corresponding table is
intCommunityTable
in the OTP-SNMPEA-MIB.Each entry is a term:
{IpAddress, CommunityString, ViewIndex, Access}.
IpAddress
is a list of four integersCommunityString
is a stringViewIndex
is an integerAccess
isread
orreadWrite
.8.2 Address Information
This information should be stored in a file called
address.conf
.The corresponding table is
intAddressTable
in the OTP-SNMPEA-MIB.Each entry is a term:
{IpAddress, UDPPort, MaxPacketSize}.
IpAddress
is a list of four integersUDPPort
is an integerMaxPacketSize
is an integer greater than or equal to 484.8.3 MIB Views
This information should be stored in a file called
view.conf
.The corresponding table is
intViewTable
in the OTP-SNMPEA-MIB.Each entry is a term:
{Index, Subtree, Status, Mask}.
Index
is an integerSubtree
is a list of integersStatus
is eitherincluded
orexcluded
Mask
is eithernull
or a list of ones and zeros. Ones nominate that an exact match is used for this sub-identifier. Zeros are wildcards which match any sub-identifier. If the mask is shorter than the subtree, the tail is regarded as all ones.null
is shorthand for a mask with all ones.8.4 Agent Information
This information should be stored in a file called
agent.conf
.Each entry is a tuple of size two:
{IntAgentVariable, Value}.
IntAgentVariable
is one of the variables in the OTP-SNMPEA-MIBValue
is the value for the variable.The following example shows a valid
agent.conf
file:{intAgentUDPPort, 161}. {intAgentIpAddress, [127, 42, 17, 5]}. {intAgentMaxPacketSize, 484}.A value must be provided for all variables which lack default values in the MIB.
8.5 Trap Destinations
This information was previously stored in a file called
trap_dest.conf
. If the agent encounters this file, but not the new target configuration files (see below), this file is automatically converted to the new files, and these new files are read.8.6 Notify Definitions
This information should be stored in a file called
notify.conf
.The corresponding table is
snmpNotifyTable
in the SNMP-NOTIFICATION-MIB.Each entry is a term:
{NotifyName, Tag, Type}.
NotifyName
is a unique stringTag
is a stringType
istrap
orinform
.8.7 Target Address Definitions
This information should be stored in a file called
target_addr.conf
.The corresponding table is
snmpTargetAddrTable
in the SNMP-TARGET-MIB.Each entry is a term:
{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName}.
TargetName
is a unique stringIp
is a list of four integersUdp
is an integerTimeout
is an integerRetryCount
is an integerTagList
is a stringParamsName
is a string8.8 Target Parameters Definitions
This information should be stored in a file called
target_params.conf
.The corresponding table is
snmpTargetParamsTable
in the SNMP-TARGET-MIB.Each entry is a term:
{ParamsName, MPModel, SecurityModel, SecurityName, SecurityLevel}.
ParamsName
is a unique stringMPModel
isv1
orv2c
SecurityModel
isotp_sec
SecurityName
is a stringSecurityLevel
isnoAuthNoPriv
8.9 System Information
This information should be stored in a file called
standard.conf
f.Each entry is a tuple of size two:
{SystemVariable, Value}.
SystemVariable
is one of the variables in the system group, orsnmpEnableAuthenTraps
.Value
is the value for the variable.The following example shows a valid
standard.conf
file:{sysDescr, "Erlang SNMP agent"}. {sysObjectID, [1,2,3]}. {sysContact, "(mbj,eklas)@erlang.ericsson.se"}. {sysName, "test"}. {sysServices, 72}. {snmpEnableAuthenTraps, enabled}.A value must be provided for all variables which lack default values in the MIB.