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,3function. 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/2at start-up.8.1 Communities
This information should be stored in a file called
community.conf.The corresponding table is
intCommunityTablein the OTP-SNMPEA-MIB.Each entry is a term:
{IpAddress, CommunityString, ViewIndex, Access}.
IpAddressis a list of four integersCommunityStringis a stringViewIndexis an integerAccessisreadorreadWrite.8.2 Address Information
This information should be stored in a file called
address.conf.The corresponding table is
intAddressTablein the OTP-SNMPEA-MIB.Each entry is a term:
{IpAddress, UDPPort, MaxPacketSize}.
IpAddressis a list of four integersUDPPortis an integerMaxPacketSizeis 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
intViewTablein the OTP-SNMPEA-MIB.Each entry is a term:
{Index, Subtree, Status, Mask}.
Indexis an integerSubtreeis a list of integersStatusis eitherincludedorexcludedMaskis eithernullor 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.nullis 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}.
IntAgentVariableis one of the variables in the OTP-SNMPEA-MIBValueis the value for the variable.The following example shows a valid
agent.conffile:{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
snmpNotifyTablein the SNMP-NOTIFICATION-MIB.Each entry is a term:
{NotifyName, Tag, Type}.
NotifyNameis a unique stringTagis a stringTypeistraporinform.8.7 Target Address Definitions
This information should be stored in a file called
target_addr.conf.The corresponding table is
snmpTargetAddrTablein the SNMP-TARGET-MIB.Each entry is a term:
{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName}.
TargetNameis a unique stringIpis a list of four integersUdpis an integerTimeoutis an integerRetryCountis an integerTagListis a stringParamsNameis a string8.8 Target Parameters Definitions
This information should be stored in a file called
target_params.conf.The corresponding table is
snmpTargetParamsTablein the SNMP-TARGET-MIB.Each entry is a term:
{ParamsName, MPModel, SecurityModel, SecurityName, SecurityLevel}.
ParamsNameis a unique stringMPModelisv1orv2cSecurityModelisotp_secSecurityNameis a stringSecurityLevelisnoAuthNoPriv8.9 System Information
This information should be stored in a file called
standard.conff.Each entry is a tuple of size two:
{SystemVariable, Value}.
SystemVariableis one of the variables in the system group, orsnmpEnableAuthenTraps.Valueis the value for the variable.The following example shows a valid
standard.conffile:{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.