snmpa_mib_data(3)
π snmpa_mib_data β the vibe guide π
okay bestie, welcome to snmpa_mib_data, a page from the snmp manual (Erlang Module Definition, if we're being precise π
). this one's the behaviour module for the SNMP agent mib-server data module. it's giving "interface contract but make it β¨" and honestly? iconic.
πΈ NAME πΈ
snmpa_mib_data β behaviour module for the SNMP agent mib-server data module. periodt.
π¦ DESCRIPTION π¦
so here's the tea β: this module defines the behaviour of the SNMP agent mib-server data module. any module that wants to be snmpa_mib_data-compliant has to export these functions, no skips, no excuses, fr fr:
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 π bestie read them, i'm not writing them twice.
heads up! the data extracted from the imported (loaded) mibs is stored partly by the mib-server and partly by the symbolic-store server. if you wanna see how that actually plays out, go peek at the default mib-server data module, snmpa_mib_data_tttn. iykyk β¨
π DATA TYPES π
filename() :: file:filename().mib_view() :: [mib_view_elem()].mib_view_elem() :: {SubTree :: snmp:oid(), Mask :: [non_neg_integer()], Inclusion :: mib_view_inclusion()}.mib_view_inclusion() :: 1 | 2.mib_view_mask() :: [non_neg_integer()].
β¨ CALLBACKS β¨
π« backup(State, BackupDir)
do a backup of the mib-server data. self-care for your mibs π
note: it's implementation dependent (and also dependent on which mib-storage is used) whether a backup is even possible. no cap.
π« close(State)
close the mib-storage. bye bestie π
π« code_change(Direction, Vsn, Extra, State)
perform a code-change (upgrade or downgrade). glow up or glow down, either way we're doing it π
see gen_server for more info regarding the Vsn and Extra arguments.
π« dump(State, Destination)
dump the mib-server data to stdio (Destination = io) or the specified file.
π« info(State)
retrieve misc info for the mib data.
this is a utility function used to inspect, for instance, memory usage, in a simple way. super handy for a lil vibe check π«Ά
π« load_mib(State, FileName, MeOverride, TeOverride)
load the mib specified by the Filename argument into the mib-server. the MeOverride and TeOverride arguments specify how the mib-server shall handle duplicate mib- and trap- entries. let it in, bestie πͺβ¨
π« lookup(State, Oid)
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
(yes, the sentence in the source literally trails off there β i'm not gonna invent an ending, that would be lying and lying is NOT the vibe π)
π« new(MibStorage)
create a new mib-server data instance. baby's first mib data πΌβ¨
π« next(State, Oid, MibView)
finds the lexicographically next oid. it's giving "next in line, no cutting" π₯
π« register_subagent(State, Oid, Pid)
register the subagent, process, handling part of the mib-tree. welcome to the team π«Ά
π« sync(State)
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). so like, if there's no disc component, this is just me yelling into the void π
π« unload_mib(State, FileName, MeOverride, TeOverride)
unload the mib specified by the Filename argument from the mib-server. the MeOverride and TeOverride arguments specify how the mib-server shall handle duplicate mib- and trap- entries. eviction notice served π
π« unregister_subagent(State, PidOrOid)
unregister the subagent, handling part of the mib-tree, as specified by the oid() or pid/0 (PidOrOid).
when unregistering the subagent using an oid(), the pid/0 of the process handling the sub-tree is also returned. two birds, one callback π¦π¦
π« whereis_mib(State, MibName)
retrieve the mib file for the mib. where is that mib? found her ππ
π« which_mib(State, Oid)
retrieve the mib-file to which a given oid() belongs. mystery solved π΅οΈββοΈ
π« which_mibs(State)
retrieve all loaded mib-files. the whole squad, assembled π
and that's the whole page, bestie, no notes π this beauty comes to you from Ericsson AB, shipping as part of snmp 5.20.5, and it's filed under snmpa_mib_data(3) β slay, drink water, and go read snmpa_mib_data_tttn next β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms