Module

snmpa_mib_data

Module Summary

Behaviour module for the SNMP agent mib-server data module.

Since

Module snmpa_mib_data was introduced in OTP R16B01.

Description

This module defines the behaviour of the SNMP agent mib-server data module. A snmpa_mib_data compliant module must export the following functions:

The semantics of them and their exact signatures are explained below.

Note that the data extracted from the imported (loaded) mibs are stored partly by the mib-server and partly by the symbolic-store server. See the default mib-server data module, snmpa_mib_data_tttn for details.

Callback functions

The following functions must be exported from a mib-server data callback module:

Exports

Module:new(Storage) -> State
OTP R16B01

Types

Create a new mib-server data instance.

Module:close(State) -> void()
OTP R16B01

Types

Close the mib-storage.

Module:sync(State) -> void()
OTP R16B01

Types

Synchronize (write to disc, if possible) the mib-server data. This depends on the mib_storage option, and will only have an effect if the mib-storage option has an actual disc component (such as dets, or ets with a file).

Module:load_mib(State, Filename, MeOverride, TeOverride) -> {ok, NewState} | {error, Reason}
OTP R16B01

Types

Load the mib specified by the Filename argument into the mib-server. The MeOverride and TeOverride arguments specifies how the mib-server shall handle duplicate mib- and trap- entries.

Module:unload_mib(State, Filename) -> {ok, NewState} | {error, Reason}
OTP R16B01

Types

Unload the mib specified by the Filename argument from the mib-server.

Module:lookup(State, Oid) -> Reply
OTP R16B01

Types

Find the mib-entry corresponding to the Oid. If it is a variable, the Oid must be <Oid for var>.0 and if it is a table, Oid must be <table>.<entry>.<col>.<any>.

Module:next(State, Oid, MibView) -> Reply
OTP R16B01

Types

Finds the lexicographically next oid.

Module:register_subagent(State, Oid, Pid) -> Reply
OTP R16B01

Types

Register the subagent, process, handling part of the mib-tree.

Module:unregister_subagent(State, PidOrOid) -> Reply
OTP R16B01

Types

Unregister the subagent, handling part of the mib-tree, as specified by the oid() or pid() (PidOrOid).

When unregister the subagent using an oid(), the pid() of the process handling the sub-tree is also returned.

Module:dump(State, Destination) -> Reply
OTP R16B01

Types

Dump the mib-server data to stdio (Destination = io) or the specified file.

Module:which_mib(State, Oid) -> Reply
OTP R16B01

Types

Retrieve the mib-file to which an given oid() belongs.

Module:which_mibs(State) -> Reply
OTP R16B01

Types

Retrieve all loaded mib-files.

Module:whereis_mib(State, MibName) -> Reply
OTP R16B01

Types

Retrieve the mib file for the mib.

Module:info(State) -> Reply
OTP R16B01

Types

Retrieve misc info for the mib data.

This is a utility function used to inspect, for instance, memory usage, in a simple way.

Module:backup(State, BackupDir) -> Reply
OTP R16B01

Types

Perform a backup of the mib-server data.

Note that its implementation dependant (and also dependent on mib-storage is used) if a backup is possible.

Module:code_change(Destination, Vsn, Extra, State) -> NewState
OTP R16B01

Types

Perform a code-change (upgrade or downgrade).

See gen_server for more info regarding the Vsn and Extra arguments.

© 2010–2020 Ericsson AB
Licensed under the Apache License, Version 2.0.