19972013
Ericsson AB. All Rights Reserved.
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
Definition of Agent Configuration Files
snmp_agent_config_files.xml
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: see
Agent Information
-
standard.conf: see
System Information
-
context.conf: see
Contexts
-
community.conf: see
Communities
-
target_addr.conf: see
Target Address Definitions
-
target_params.conf: see
Target Parameters Definitions
-
vacm.conf: see
MIB Views for VACM
-
usm.conf: see
Security data for USM
-
notify.conf: see
Notify 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.
Agent Information
The agent information should be stored in a file called
agent.conf.
Each entry is a tuple of size two:
{AgentVariable, Value}.
-
AgentVariable is one of the variables is
SNMP-FRAMEWORK-MIB or one of the internal variables
intAgentUDPPort, which defines which UDP port the agent
listens to, or intAgentIpAddress, which defines the IP
address of the agent.
-
Value is the value for the variable.
The following example shows a agent.conf file:
{intAgentUDPPort, 4000}.
{intAgentIpAddress,[141,213,11,24]}.
{snmpEngineID, "mbj's engine"}.
{snmpEngineMaxPacketSize, 484}.
The value of snmpEngineID is a string, which for a
deployed agent should have a very specific structure. See
RFC 2271/2571 for details.
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.
-
ContextName is a string.
System Information
The system information should be stored in a file called
standard.conf.
Each entry is a tuple of size two:
{SystemVariable, Value}.
-
SystemVariable is one of the variables in the
system group, or snmpEnableAuthenTraps.
-
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.
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}.
-
CommunityIndex is a non-empty string.
-
CommunityName is a string.
-
SecurityName is a string.
-
ContextName is a string.
-
TransportTag is a string.
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}.
-
SecModel is any, v1, v2c, or
usm.
-
SecName is a string.
-
GroupName is a string.
-
Prefix is a string.
-
SecLevel is noAuthNoPriv, authNoPriv,
or authPriv
-
Match is prefix or exact.
-
ReadView is a string.
-
WriteView is a string.
-
NotifyView is a string.
-
ViewIndex is an integer.
-
ViewSubtree is a list of integer.
-
ViewStatus is either included or excluded
-
ViewMask is either null or 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. null is shorthand for a
mask with all ones.
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}.
-
EngineID is a string.
-
UserName is a string.
-
SecName is a string.
-
Clone is zeroDotZero or a list of integers.
-
AuthP is a usmNoAuthProtocol,
usmHMACMD5AuthProtocol, or usmHMACSHAAuthProtocol.
-
AuthKeyC is a string.
-
OwnAuthKeyC is a string.
-
PrivP is a usmNoPrivProtocol,
usmDESPrivProtocol or usmAesCfb128Protocol.
-
PrivKeyC is a string.
-
OwnPrivKeyC is a string.
-
Public is a string.
-
AuthKey is 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 if usmHMACMD5AuthProtocol is used,
and 20 if usmHMACSHAAuthProtocol is used.
-
PrivKey is 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 if usmDESPrivProtocol or
usmAesCfb128Protocol is used.
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}.
-
NotifyName is a unique non-empty string.
-
Tag is a string.
-
Type is trap or inform.
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, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId}.
or
{TargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.
or
{TargetName, Domain, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask, MaxMessageSize}.
-
TargetName is a unique non-empty string.
-
Domain is one of the atoms:
transportDomainUdpIpv4 | transportDomainUdpIpv6.
-
Ip is a list of four or eight integers.
-
Udp is an integer.
-
Timeout is an integer.
-
RetryCount is an integer.
-
TagList is a string.
-
ParamsName is a string.
-
EngineId is a string or the atom discovery.
-
TMask is a list of integer() of size 0,
size 6 or size 10 (default: []).
-
MaxMessageSize is an integer (default: 2048).
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.
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}.
-
ParamsName is a unique non-empty string.
-
MPModel is v1, v2c or v3
-
SecurityModel is v1, v2c, or usm.
-
SecurityName is a string.
-
SecurityLevel is noAuthNoPriv, authNoPriv
or authPriv.