• No results found

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 thesnmp 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 [page 9] 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 functionconfig err/2of the error report module at start-up.

1.8.1

Agent Information

The agent information should be stored in a file calledagent.conf. Each entry is a tuple of size two:

fAgentVariable, Valueg.

AgentVariableis one of the variables is SNMP-FRAMEWORK-MIB or one of the internal

variablesintAgentUDPPort, which defines which UDP port the agent listens to, or intAgentIpAddress, which defines the IP address of the agent.

Valueis the value for the variable.

The following example shows aagent.conffile:

fintAgentUDPPort, 4000g.

fintAgentIpAddress,[141,213,11,24]g. fsnmpEngineID, "mbj’s engine"g. fsnmpEngineMaxPacketSize, 484g.

The value ofsnmpEngineIDis a string, which for a deployed agent should have a very specific structure. See RFC 2271/2571 for details.

1.8: Definition of Configuration Files

1.8.2

Contexts

The context information should be stored in a file calledcontext.conf. The default context""need not be present.

Each row defines a context in the agent. This information is used in the tablevacmContextTablein the SNMP-VIEW-BASED-ACM-MIB.

Each entry is a term: ContextName.

ContextNameis a string.

1.8.3

System Information

The system information should be stored in a file calledstandard.conf. Each entry is a tuple of size two:

fSystemVariable, Valueg.

SystemVariableis one of the variables in the system group, orsnmpEnableAuthenTraps. Valueis the value for the variable.

The following example shows a validstandard.conffile:

fsysDescr, "Erlang SNMP agent"g. fsysObjectID, [1,2,3]g.

fsysContact, "(mbj,eklas)@erlang.ericsson.se"g. fsysName, "test"g.

fsysServices, 72g.

fsnmpEnableAuthenTraps, enabledg.

A value must be provided for all variables, which lack default values in the MIB.

1.8.4

Communities

The community information should be stored in a file calledcommunity.conf. It must be present if the agent is configured for SNMPv1 or SNMPv2c.

The corresponding table issnmpCommunityTablein the SNMP-COMMUNITY-MIB. Each entry is a term:

fCommunityIndex, CommunityName, SecurityName, ContextName, TransportTagg. CommunityIndexis a non-empty string.

CommunityNameis a string. SecurityNameis a string. ContextNameis a string. TransportTagis a string.

1.8.5

MIB Views for VACM

The information about MIB Views for VACM should be stored in a file calledvacm.conf. The corresponding tables arevacmSecurityToGroupTable,vacmAccessTableand vacmViewTreeFamilyTablein the SNMP-VIEW-BASED-ACM-MIB.

Each entry is one of the terms, one entry corresponds to one row in one of the tables.

fvacmSecurityToGroup, SecModel, SecName, GroupNameg.

fvacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, ReadView, WriteView,

NotifyViewg.

fvacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMaskg. 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 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.

1.8.6

Security data for USM

The information about Security data for USM should be stored in a file calledusm.conf, which must be present if the agent is configured for SNMPv3.

The corresponding table isusmUserTablein the SNMP-USER-BASED-SM-MIB. Each entry is a term:

fEngineID, UserName, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, PrivP, PrivKeyC,

OwnPrivKeyC, Public, AuthKey, PrivKeyg. EngineIDis a string.

UserNameis a string. SecNameis a string.

CloneiszeroDotZeroor a list of integers.

AuthPis eitherusmNoAuthProtocol,usmHMACMD5AuthProtocol, orusmHMACSHAAuthProtocol. AuthKeyCis a string.

OwnAuthKeyCis a string.

1.8: Definition of Configuration Files

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 if usmHMACSHAAuthProtocolis 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 ifusmDESPrivProtocolis used.

1.8.7

Notify Definitions

The information about Notify Definitions should be stored in a file callednotify.conf. The corresponding table issnmpNotifyTablein the SNMP-NOTIFICATION-MIB. Each entry is a term:

fNotifyName, Tag, Typeg.

NotifyNameis a unique non-empty string. Tagis a string.

Typeistraporinform.

1.8.8

Target Address Definitions

The information about Target Address Definitions should be stored in a file calledtarget addr.conf. The corresponding tables aresnmpTargetAddrTablein the SNMP-TARGET-MIB and

snmpTargetAddrExtTablein the SNMP-COMMUNITY-MIB. Each entry is a term:

fTargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsNameg.or

fTargetName, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId, TMask,

MaxMessageSizeg.

TargetNameis a unique non-empty string. Ipis a list of four integers.

Udpis an integer. Timeoutis an integer. RetryCountis an integer. TagListis a string. ParamsNameis a string. EngineIdis a string.

TMaskis a string of size 0, or size 6. MaxMessageSizeis an integer.

1.8.9

Target Parameters Definitions

The information about Target Parameters Definitions should be stored in a file called target params.conf.

The corresponding table issnmpTargetParamsTablein the SNMP-TARGET-MIB. Each entry is a term:

fParamsName, MPModel, SecurityModel, SecurityName, SecurityLevelg. ParamsNameis a unique non-empty string.

MPModelisv1,v2corv3

SecurityModelisv1,v2c, orusm. SecurityNameis a string.

SecurityLevelisnoAuthNoPriv,authNoPrivorauthPriv.

Related documents