8 Definition of Configuration Files
All configuration data must be included in configuration files that are located in the configuration directory. The name of this directory is given in the
snmp_config_dirconfiguration parameter. These files are read at start-up, and are used to initialize the SNMPv2-MIB or STANDARD-MIB, SNMP-FRAMEWORK-MIB, SNMP-MPD-MIB, SNMP-VIEW-BASED-ACM-MIB, SNMP-COMMUNITY-MIB, SNMP-USER-BASED-SM-MIB, SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB (refer to the Management of the Agent for a description of the 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 Agent Information
The agent information should be stored in a file called
agent.conf.Each entry is a tuple of size two:
{AgentVariable, Value}.
AgentVariableis one of the variables is SNMP-FRAMEWORK-MIB or one of the internal variablesintAgentUDPPort, which defines which UDP port the agent listens to, orintAgentIpAddress, which defines the IP address of the agent.Valueis the value for the variable.The following example shows a
agent.conffile:{intAgentUDPPort, 4000}. {intAgentIpAddress,[141,213,11,24]}. {snmpEngineID, "mbj's engine"}. {snmpEngineMaxPacketSize, 484}.The value of
snmpEngineIDis a string, which for a deployed agent should have a very specific structure. See RFC 2271/2571 for details.8.2 Contexts
The context information should be stored in a file called
context.conf. The default context""need not be present.Each row defines a context in the agent. This information is used in the table
vacmContextTablein the SNMP-VIEW-BASED-ACM-MIB.Each entry is a term:
ContextName.
ContextNameis a string.8.3 System Information
The system information should be stored in a file called
standard.conf.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.
8.4 Communities
The community information should be stored in a file called
community.conf. It must be present if the agent is configured for SNMPv1 or SNMPv2c.The corresponding table is
snmpCommunityTablein the SNMP-COMMUNITY-MIB.Each entry is a term:
{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.
CommunityIndexis a string.CommunityNameis a string.SecurityNameis a string.ContextNameis a string.TransportTagis a string.8.5 MIB Views for VACM
The information about MIB Views for VACM should be stored in a file called
vacm.conf.The corresponding tables are
vacmSecurityToGroupTable,vacmAccessTableandvacmViewTreeFamilyTablein the SNMP-VIEW-BASED-ACM-MIB.Each entry is one of the terms, one entry corresponds to one row in one of the tables.
{vacmSecurityToGroup, SecModel, SecName, GroupName}.
{vacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, ReadView, WriteView, NotifyView}.
{vacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMask}.
SecModelisany,v1,v2c, orusm.
SecNameis a string.
GroupNameis a string.
Prefixis a string.
SecLevelisnoAuthNoPriv,authNoPriv<c>, or <c>authPriv
Matchisprefixorexact.
ReadViewis a string.
WriteViewis a string.
Notifyiewis a string.
ViewIndexis an integer.
ViewSubtreeis a list of integer.
ViewStatusis eitherincludedorexcluded
ViewMaskis 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.6 Security data for USM
The information about Security data for USM should be stored in a file called
usm.conf, which must be present if the agent is configured for SNMPv3.The corresponding table is
usmUserTablein the SNMP-USER-BASED-SM-MIB.Each entry is a term:
{EngineID, UserName, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey}.
EngineIDis a string.
UserNameis a string.
SecNameis a string.
CloneiszeroDotZeroor a list of integers.
AuthPis ausmNoAuthProtocol,usmHMACMD5AuthProtocol, orusmHMACSHAAuthProtocol.
AuthKeyCis a string.
OwnAuthKeyCis a string.
PrivPis ausmNoPrivProtocolorusmDESPrivProtocol.
PrivKeyCis a string.
OwnPrivKeyCis a string.
Publicis a string.
AuthKeyis a string. This is the User's secret localized authentication key. It is not visible in the MIB. The length of this key needs to be 16 ifusmHMACMD5AuthProtocolis used, and 20 ifusmHMACSHAAuthProtocolis used.
PrivKeyis a string. This is the User's secret localized encryption key. It is not visible in the MIB. The length of this key needs to be 16 ifusmDESPrivProtocolis used.
8.7 Trap Destinations
The information about Trap Destinations 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.8 Notify Definitions
The information about Notify Definitions 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 string.
Tagis a string.
Typeistraporinform.
8.9 Target Address Definitions
The information about Target Address Definitions should be stored in a file called
target_addr.conf.The corresponding tables are
snmpTargetAddrTablein the SNMP-TARGET-MIB andsnmpTargetAddrExtTablein the SNMP-COMMUNITY-MIB.Each entry is a term:
{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName}.or
{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, TMask, MaxMessageSize}.
TargetNameis a unique string.
Ipis a list of four integers.
Udpis an integer.
Timeoutis an integer.
RetryCountis an integer.
TagListis a string.
ParamsNameis a string.
TMaskis a string of size 0, or size 6.
MaxMessageSizeis an integer.
8.10 Target Parameters Definitions
The information about Target Parameters Definitions 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 string.
MPModelisv1,v2corv3
SecurityModelisv1,v2c, orusm.
SecurityNameis a string.
SecurityLevelisnoAuthNoPriv,authNoPrivorauthPriv.