snmpa_mib_data(3erl)
snmpa_mib_data π β¨
okay so this is the snmpa_mib_data(3erl) page from the Erlang Module Definition set, bestie. We're talking the behaviour module for the SNMP agent mib-server data module, and it's lowkey iconic.
β¨ NAME β¨
snmpa_mib_data β Behaviour module for the SNMP agent mib-server data module. periodt.
π¦ 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, no exceptions:
new/1close/1sync/1load_mib/4unload_mib/4lookup/2next/3register_subagent/3unregister_subagent/2which_mib/2which_mibs/1whereis_mib/2dump/2info/1backup/2code_change/4
The semantics of them and their exact signatures are explained below, promise. Their exact signatures? Below. The semantics? Also below. We got you.
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. iykyk.
πΈ CALLBACK FUNCTIONS πΈ
The following functions must be exported from a mib-server data callback module:
π EXPORTS π
Module:new(Storage) -> State
Types:
Storage = mib_storage()
State = term()
Create a new mib-server data instance. fresh start energy.
Module:close(State) -> void()
Types:
State = term()
Close the mib-storage. bye bestie.
Module:sync(State) -> void()
Types:
State = term()
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). disc sync moment.
Module:load_mib(State, Filename, MeOverride, TeOverride) -> {ok, NewState} | {error, Reason}
Types:
State = NewState = term()
Filename = filename()
MeOverride = boolean()
TeOverride = boolean()
Reason = already_loaded | term()
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. duplicate drama handled.
Module:unload_mib(State, Filename) -> {ok, NewState} | {error, Reason}
Types:
State = NewState = term()
Filename = filename()
Reason = not_loaded | term()
Unload the mib specified by the Filename argument from the mib-server. taking out the trash, mib edition.
Module:lookup(State, Oid) -> Reply
Types:
State = term()
Reply = {variable, ME} | {table_column, ME, TEOid} | {subagent, SAPid, SAOid} | {false, Reason}
Oid = TEOid = SAOid = oid()
SAPid = pid()
ME = me()
Reason = term()
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>. gotcha, bestie.
Module:next(State, Oid, MibView) -> Reply
Types:
State = term()
Reply = false | endOfTable | {subagent, SAPid, SAOid} | {variable, ME, VarOid} | {table, TableOid, TableRestOid, ME}
Oid = SAOid = VarOid = TableOid = TableRestOid = oid()
SAPid = pid()
ME = me()
Finds the lexicographically next oid. next!
Module:register_subagent(State, Oid, Pid) -> Reply
Types:
State = NewState = term()
Reply = {ok, NewState} | {error, Reason}
Oid = oid()
Pid = pid()
Reason = term()
Register the subagent, process, handling part of the mib-tree. subagent activated.
Module:unregister_subagent(State, PidOrOid) -> Reply
Types:
State = NewState = term()
Reply = {ok, NewState} | {ok, NewState, Pid} | {error, Reason}
PidOrOid = pid() | oid()
Pid = pid()
Reason = term()
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. cleanup with receipts.
Module:dump(State, Destination) -> Reply
Types:
State = term()
Reply = ok | {error, Reason}
Destination = io | filename()
Pid = pid()
Reason = term()
Dump the mib-server data to stdio (Destination = io) or the specified file. spill the tea, data edition.
Module:which_mib(State, Oid) -> Reply
Types:
State = term()
Reply = {ok, MibFile} | {error, Reason}
Oid = oid()
MibFile = string()
Reason = term()
Retrieve the mib-file to which an given oid() belongs. mib detective work.
Module:which_mibs(State) -> Reply
Types:
State = term()
Reply = [{MibName, Filename}]
MibName = atom()
Filename = string()
Retrieve all loaded mib-files. the whole collection.
Module:whereis_mib(State, MibName) -> Reply
Types:
State = term()
MibName = atom()
Reply = {ok, Filename} | {error, Reason}
Filename = string()
Reason = term()
Retrieve the mib file for the mib. where is it? found it.
Module:info(State) -> Reply
Types:
State = term()
Reply = {ok, Filename} | {error, Reason}
Filename = string()
Reason = term()
Retrieve misc info for the mib data.
This is a utility function used to inspect, for instance, memory usage, in a simple way. vibe check on memory.
Module:backup(State, BackupDir) -> Reply
Types:
State = term()
Reply = ok | {error, Reason}
BackupDir = string()
Reason = term()
Perform a backup of the mib-server data.
Note: its implementation dependent (and also dependent on mib-storage is used) if a backup is possible. so check your setup first, bestie.
Module:code_change(Destination, Vsn, Extra, State) -> NewState
Types:
Destination = up | down
Vsn = term()
Extra = term()
State = NewState = term()
Perform a code-change (upgrade or downgrade).
See gen_server for more info regarding the Vsn and Extra arguments. upgrade/downgrade glam.
That's the whole page, bestie! Big sign-off energy from Ericsson AB, snmp version 5.13.5, and this iconic snmpa_mib_data(3erl) manual page. Mwah! πβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms