Erlang -- Manager Implementation Example

User's Guide
Reference Manual
Release Notes
PDF
Top

Simple Network Management Protocol (SNMP)
User's Guide
Version 4.22.1

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

# 9 Manager Implementation Example

This Implementation Example section describes how a simple manager can be implemented with the SNMP Development Toolkit.

The example shown, ex2, can be found in the toolkit distribution.

This example has two functions:

- A simple example of how to use the manager component of the SNMP Development Toolkit.

- A simple example of how to write agent test cases, using the new manager.

### 9.1 The example manager

The example manager, snmp_ex2_manager, is a simple example of how to implement an snmp manager using the manager component of the SNMP Development Toolkit.

The module exports the following functions:

- start_link/0, start_link/1

- stop/0

- agent/2, agent/3

- sync_get/2, sync_get/3

- sync_get_next/2, sync_get_next/3

- sync_get_bulk/4, sync_get_bulk/5

- sync_set/2, sync_set/3

- oid_to_name/1

This module is also used by the test module described in the next section.

### 9.2 A simple standard test

This simple standard test, snmp_ex2_simple_standard_test, a module which, using the snmp_ex2_manager described in the previous section, implements a simple agent test utility.