Erlang -- Definition of Manager Configuration Files

Simple Network Management Protocol (SNMP)

User's Guide

Version 5.9

- User's Guide
- Reference Manual
- Release Notes
- PDF
- Top

- Expand All
- Contract All

### Chapters

- SNMP Introduction
  - Top of chapter
  - Scope and Purpose
  - Prerequisites
  - Definitions
  - About This Manual
  - Where to Find More Information
- Agent Functional Description
  - Top of chapter
  - Features
  - SNMPv1, SNMPv2 and SNMPv3
  - Operation
  - Sub-agents and MIB Loading
  - Contexts and Communities
  - Management of the Agent
  - Notifications
  - Discovery
- Manager Functional Description
  - Top of chapter
  - Features
  - Operation
  - MIB loading
- The MIB Compiler
  - Top of chapter
  - Operation
  - Importing MIBs
  - MIB Consistency Checking
  - .hrl File Generation
  - Emacs Integration
  - Compiling from a Shell or a Makefile
  - Deviations from the Standard
- Running the application
  - Top of chapter
  - Configuring the application
  - Modifying the Configuration Files
  - Starting the application
  - Debugging the application
- Definition of Agent Configuration Files
  - Top of chapter
  - Agent Information
  - Contexts
  - System Information
  - Communities
  - MIB Views for VACM
  - Security data for USM
  - Notify Definitions
  - Target Address Definitions
  - Target Parameters Definitions
- Definition of Manager Configuration Files
  - Top of chapter
  - Manager Information
  - Users
  - Agents
  - Security data for USM
- Agent Implementation Example
  - Top of chapter
  - MIB
  - Default Implementation
  - Manual Implementation
- Manager Implementation Example
  - Top of chapter
  - The example manager
  - A simple standard test
- Instrumentation Functions
  - Top of chapter
  - Instrumentation Functions
  - Using the ExtraArgument
  - Default Instrumentation
  - Atomic Set
- Definition of Instrumentation Functions
  - Top of chapter
  - Variable Instrumentation
  - Table Instrumentation
- Definition of Agent Net if
  - Top of chapter
  - Mandatory Functions
  - Messages
- Definition of Manager Net if
  - Top of chapter
  - Mandatory Functions
  - Messages
  - Notes
- Audit Trail Log
  - Top of chapter
  - Agent Logging
  - Manager Logging
- Advanced Agent Topics
  - Top of chapter
  - When to use a Sub-agent
  - Agent Semantics
  - Sub-agents and Dependencies
  - Distributed Tables
  - Fault Tolerance
  - Using Mnesia Tables as SNMP Tables
  - Deviations from the Standard
- SNMP Appendix A
  - Top of chapter
  - Appendix A
- SNMP Appendix B
  - Top of chapter
  - Appendix B

# 7 Definition of Manager Configuration Files

Configuration data may be included in configuration files that is 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.

The directory where the configuration files are found is given as a parameter to the manager.

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.

If syntax errors are discovered in these files they are reported with the function config_err/2 of the error report module at start-up.

### 7.1 Manager Information

The manager information should be stored in a file called manager.conf.

Each entry is a tuple of size two:

{Variable, Value}.

- Variable is one of the following:

  - transports - which defines the transport domains and their addresses for the manager. Mandatory

    Value is a list of {Domain, Addr} tuples or Domain atoms.

    - Domain is one of transportDomainUdpIpv4 or transportDomainUdpIpv6.

    - Addr is for the currently supported domains either an IpAddr or 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 Addr does not contain a port number, the value of port is used.

      When a Addr is not specified i.e by using only a Domain atom, the host's name is resolved to find the IP address, and the value of port is used.

  - port - which defines which UDP port the manager uses for communicating with agents. Mandatory if transports does not define a port number for every transport.

  - engine_id - The SnmpEngineID as defined in SNMP-FRAMEWORK-MIB. Mandatory.

  - max_message_size - The snmpEngineMaxMessageSize as defined in SNMP-FRAMEWORK-MIB. Mandatory.

- Value is the value for the variable.

The legacy and intermediate variables address and domain are still supported so old configurations will work.

The following example shows a manager.conf file:

    {transports,       [{transportDomainUdpIpv4, {{141,213,11,24}, 5000}},
                        {transportDomainUdpIpv6, {{0,0,0,0,0,0,0,1}, 5000}}]}.
    {engine_id,        "mgrEngine"}.
    {max_message_size, 484}.

The value of engine_id is a string, which should have a very specific structure. See RFC 2271/2571 for details.

### 7.2 Users

For each manager user, the manager needs some information. This information is either added in the users.conf config file or by calling the register_user function in run-time.

Each row defines a manager user of the manager.

Each entry is a tuple of size four:

{UserId, UserMod, UserData, DefaultAgentConfig}.

- UserId is any term (used to uniquely identify the user).

- UserMod is the user callback module (atom).

- UserData is any term (passed on to the user when calling the UserMod.

- DefaultAgentConfig is a list of default agent config's. These values are used as default values when this user registers agents.

### 7.3 Agents

The information needed to handle agents should be stored in a file called agents.conf. It is also possible to add agents in run-time by calling the register_agent.

Each entry is a tuple:

{UserId, TargetName, Comm, Domain, Addr, EngineID, Timeout, MaxMessageSize, Version, SecModel, SecName, SecLevel}.

- UserId is the identity of the manager user responsible for this agent (term).

- TargetName is a unique non-empty string.

- Comm is the community string (string).

- Domain is the transport domain, either transportDomainUdpIpv4 or transportDomainUdpIpv6.

- Addr is the address in the transport domain, either an {IpAddr, IpPort} tuple or a traditional SNMP integer list containing port number. IpAddr is either a regular Erlang/OTP ip_address() or a traditional SNMP integer list not containing port number, and IpPort is an integer.

- EngineID is the engine-id of the agent (string).

- Timeout is re-transmission timeout (infinity | integer).

- MaxMessageSize is the max message size for outgoing messages to this agent (integer).

- Version is the version (v1 | v2 | v3).

- SecModel is the security model (any | v1 | v2c | usm).

- SecName is the security name (string).

- SecLevel is security level (noAuthNoPriv | authNoPriv | authPriv).

Legacy configurations using tuples without Domain element, as well as with all TDomain, Ip and Port elements still work.

### 7.4 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 manager wishes to use SNMPv3 when communicating with agents. It is also possible to add usm data in run-time by calling the register_usm_user.

The corresponding table is usmUserTable in the SNMP-USER-BASED-SM-MIB.

Each entry is a term:

{EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey}.
{EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey}.

The first case is when we have the identity-function (SecName = UserName).

- EngineID is a string.

- UserName is a string.

- SecName is a string.

- AuthP is a usmNoAuthProtocol, usmHMACMD5AuthProtocol or usmHMACSHAAuthProtocol.

- 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.

- PrivP is a usmNoPrivProtocol, usmDESPrivProtocol or usmAesCfb128Protocol.

- 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.