6 Definition of Agent 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 config_dir configuration 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 files are:
-
agent.conf: seeAgent Information -
standard.conf: seeSystem Information -
context.conf: seeContexts -
community.conf: seeCommunities -
target_addr.conf: seeTarget Address Definitions -
target_params.conf: seeTarget Parameters Definitions -
vacm.conf: seeMIB Views for VACM -
usm.conf: seeSecurity data for USM -
notify.conf: seeNotify Definitions
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 config_err/2 of the error report module at start-up.
6.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, orintAgentTransports, which defines the transport domains and addresses of the agent. -
Valueis the value for the variable.
The following example shows an agent.conf file:
{intAgentUDPPort, 4000}.
{intAgentTransports,
[{transportDomainUdpIpv4, {141,213,11,24}},
{transportDomainUdpIpv6, {0,0,0,0,0,0,0,1}}]}.
{snmpEngineID, "mbj's engine"}.
{snmpEngineMaxPacketSize, 484}.
The value of intAgentTransports is a list of {Domain, Addr} tuples, where Domain is either transportDomainUdpIpv4 or transportDomainUdpIpv6, and Addr is the address in the domain. Addr can be specified either as an IpAddr or as an {IpAddr, IpPort} tuple. IpAddr is either a regular Erlang/OTP ip_address() or a traditional SNMP integer list and IpPort is an integer.
When the Addr value does not contain a port number, the value of intAgentUDPPort is used.
The legacy and intermediate variables intAgentIpAddress and intAgentTransportDomain are still supported so old agent.conf files will work.
The value of snmpEngineID is a string, which for a deployed agent should have a very specific structure. See RFC 2271/2571 for details.
6.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 vacmContextTable in the SNMP-VIEW-BASED-ACM-MIB.
Each entry is a term:
ContextName.
-
ContextNameis a string.
6.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.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.
6.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.
An SNMP community is a relationship between an SNMP agent and a set of SNMP managers that defines authentication, access control and proxy characteristics.
The corresponding table is snmpCommunityTable in the SNMP-COMMUNITY-MIB.
Each entry is a term:
{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.
-
CommunityIndexis a non-empty string. -
CommunityNameis a string. -
SecurityNameis a string. -
ContextNameis a string. -
TransportTagis a string.
6.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, vacmAccessTable and vacmViewTreeFamilyTable in 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, orauthPriv -
Matchisprefixorexact. -
ReadViewis a string. -
WriteViewis a string. -
NotifyViewis 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 wild-cards which match any sub-identifier. If the mask is shorter than the sub-tree, the tail is regarded as all ones.nullis shorthand for a mask with all ones.
6.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 usmUserTable in 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 ausmNoPrivProtocol,usmDESPrivProtocolorusmAesCfb128Protocol. -
PrivKeyCis a string. -
OwnPrivKeyCis a string. -
Publicis a string. -
AuthKeyis a list (of integer). 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 list (of integer). 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 ifusmDESPrivProtocolorusmAesCfb128Protocolis used.
6.7 Notify Definitions
The information about Notify Definitions 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}.
-
NotifyNameis a unique non-empty string. -
Tagis a string. -
Typeistraporinform.
6.8 Target Address Definitions
The information about Target Address Definitions should be stored in a file called target_addr.conf.
The corresponding tables are snmpTargetAddrTable in the SNMP-TARGET-MIB and snmpTargetAddrExtTable in the SNMP-COMMUNITY-MIB.
Each entry is a term:
{TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId}.
or
{TargetName, Domain, Addr, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.
-
TargetNameis a unique non-empty string. -
Domainis one of the atoms:transportDomainUdpIpv4|transportDomainUdpIpv6. -
Addris either anIpAddror an{IpAddr, IpPort}tuple.IpAddris either a regular Erlang/OTPip_address()or a traditional SNMP integer list, andIpPortis an integer.If
IpPortis omitted162is used. -
Timeoutis an integer. -
RetryCountis an integer. -
TagListis a string. -
ParamsNameis a string. -
EngineIdis a string or the atomdiscovery. -
TMaskis specified just asAddror as[]. Note in particular that using a list of 6 bytes for IPv4 or 8 words plus 2 bytes for IPv6 are still valid address formats so old configurations will work. -
MaxMessageSizeis an integer (default: 2048).
The old tuple formats with Ip address and Udp port number found in old configurations still work.
Note that if EngineId has the value discovery, the agent cannot send inform messages to that manager until it has performed the discovery process with that manager.
6.9 Target Parameters Definitions
The information about Target Parameters Definitions 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}.
-
ParamsNameis a unique non-empty string. -
MPModelisv1,v2corv3 -
SecurityModelisv1,v2c, orusm. -
SecurityNameis a string. -
SecurityLevelisnoAuthNoPriv,authNoPrivorauthPriv.
© 2010–2017 Ericsson AB
Licensed under the Apache License, Version 2.0.