Search documentation of snmp

# View Source snmp_framework_mib (snmp v5.16)

Instrumentation Functions for SNMP-FRAMEWORK-MIB

The module `snmp_framework_mib` implements instrumentation functions for the SNMP-FRAMEWORK-MIB, and functions for initializing and configuring the database.

The configuration files are described in the SNMP User's Manual.

# Summary

## Types

admin_string()

`OCTET STRING (SIZE(0..255))`

engine_id()

`OCTET STRING (SIZE(5..32))`

max_message_size()

> #### Note

> "The maximum length in octets of an SNMP message which this SNMP engine can send or receive and process, determined as the minimum of the maximum message size values supported among all of the transports available to and supported by the engine."

message_processing_model()

> #### Note

> "As of this writing, there are several values of messageProcessingModel defined for use with SNMP. They are as follows: "

security_level()

> #### Note

> "A Level of Security at which SNMP messages can be sent or with which operations are being processed; in particular, one of: "

security_model()

> #### Note

> "As of this writing, there are several values of securityModel defined for use with SNMP or reserved for use with supporting MIB objects. They are as follows: "

## Functions

add_context(Ctx)

Adds a context to the agent config. Equivalent to one line in the `context.conf` file.

configure(ConfDir)

This function is called from the supervisor at system start-up.

delete_context(Key)

Delete a context from the agent config.

init()

This function is called from the supervisor at system start-up.

# Types

Link to this type

# admin_string()

View Source

    -type admin_string() :: string().

`OCTET STRING (SIZE(0..255))`

Link to this type

# engine_id()

View Source

    -type engine_id() :: string().

`OCTET STRING (SIZE(5..32))`

Link to this type

# max_message_size()

View Source

    -type max_message_size() :: 484..2147483647.

> #### Note

> "The maximum length in octets of an SNMP message which this SNMP engine can send or receive and process, determined as the minimum of the maximum message size values supported among all of the transports available to and supported by the engine."

`INTEGER (484..2147483647)`

Link to this type

# message_processing_model()

View Source

    -type message_processing_model() :: v1 | v2c | v3.

> #### Note

> "As of this writing, there are several values of messageProcessingModel defined for use with SNMP. They are as follows: "

>                             0  reserved for SNMPv1
>                             1  reserved for SNMPv2c
>                             2  reserved for SNMPv2u and SNMPv2*
>                             3  reserved for SNMPv3

`INTEGER(0 .. 2147483647)`

Link to this type

# security_level()

View Source

    -type security_level() :: noAuthNoPriv | authNoPriv | authPriv.

> #### Note

> "A Level of Security at which SNMP messages can be sent or with which operations are being processed; in particular, one of: "

>                           noAuthNoPriv - without authentication and
>                                          without privacy,
>                           authNoPriv   - with authentication but
>                                          without privacy,
>                           authPriv     - with authentication and
>                                          with privacy.

> "These three values are ordered such that noAuthNoPriv is less than authNoPriv and authNoPriv is less than authPriv."

`INTEGER { noAuthNoPriv(1), authNoPriv(2), authPriv(3) }`

Link to this type

# security_model()

View Source

    -type security_model() :: any | v1 | v2c | usm.

> #### Note

> "As of this writing, there are several values of securityModel defined for use with SNMP or reserved for use with supporting MIB objects. They are as follows: "

>                             0  reserved for 'any'
>                             1  reserved for SNMPv1
>                             2  reserved for SNMPv2c
>                             3  User-Based Security Model (USM)

`INTEGER(0 .. 2147483647)`

# Functions

Link to this function

# add_context(Ctx)

View Source

    -spec add_context(Ctx) -> {ok, Key} | {error, Reason}
                         when Ctx :: string(), Key :: term(), Reason :: term().

Adds a context to the agent config. Equivalent to one line in the `context.conf` file.

Link to this function

# configure(ConfDir)

View Source

    -spec configure(ConfDir) -> snmp:void() when ConfDir :: string().

This function is called from the supervisor at system start-up.

Inserts all data in the configuration files into the database and destroys all old data.

Thus, the data in the SNMP-FRAMEWORK-MIB, after this function has been called, is from the configuration files.

All `snmp` counters are set to zero.

If an error is found in the configuration file, it is reported using the function `config_err/2` of the error report module, and the function fails with reason `configuration_error`.

`ConfDir` is a string which points to the directory where the configuration files are found.

The configuration file read is: `context.conf`.

Link to this function

# delete_context(Key)

View Source

    -spec delete_context(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

Delete a context from the agent config.

Link to this function

# init()

View Source

    -spec init() -> snmp:void().

This function is called from the supervisor at system start-up.

Creates the necessary objects in the database if they do not exist. It does not destroy any old values.