snmp_framework_mib(3)
π snmp_framework_mib π
okay bestie, gather round, because we're about to get into snmp_framework_mib, which lives in the Erlang Module Definition section of the manual (that's the man page fam, snmp_framework_mib(3) π«Ά). she's the one who handles instrumentation, so let's get into it.
β¨ NAME β¨
snmp_framework_mib β Instrumentation Functions for SNMP-FRAMEWORK-MIB
πΈ DESCRIPTION πΈ
So the module snmp_framework_mib is out here implementing instrumentation functions for the SNMP-FRAMEWORK-MIB, plus the functions you need for initializing and configuring the database. main character behaviour, honestly. π
And the configuration files? They're described in the SNMP User's Manual. go read that, iykyk.
π¦ DATA TYPES π¦
admin_string() :: string().
it's giving OCTET STRING (SIZE(0..255)) β¨
engine_id() :: string().
and this one is OCTET STRING (SIZE(5..32)) π
max_message_size() :: 484..2147483647.
okay so the spec note here says (and i'm quoting the vibe, not changing a single number): "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."
and the type is INTEGER (484..2147483647). those bounds are real, don't come for me. π₯
message_processing_model() :: v1 | v2c | v3.
the note literally says: "As of this writing, there are several values of messageProcessingModel defined for use with SNMP. They are as follows: "
0β reserved for SNMPv11β reserved for SNMPv2c2β reserved for SNMPv2u and SNMPv2*3β reserved for SNMPv3
and the underlying type is INTEGER(0 .. 2147483647). periodt. π
security_level() :: noAuthNoPriv | authNoPriv | authPriv.
the 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.
also, quote: "These three values are ordered such that noAuthNoPriv is less than authNoPriv and authNoPriv is less than authPriv." so like, there's a hierarchy, bestie, respect it.
the actual integer situation: INTEGER { noAuthNoPriv(1), authNoPriv(2), authPriv(3) } π
security_model() :: any | v1 | v2c | usm.
note says: "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 SNMPv12β reserved for SNMPv2c3β User-Based Security Model (USM)
typed as INTEGER(0 .. 2147483647). slay. π
π FUNCTIONS π
add_context(Ctx) -> {ok, Key} | {error, Reason}
with
when
Ctx :: string(),
Key :: term(),
Reason :: term().
adds a context to the agent config. literally the exact same thing as one single line in the context.conf file. one line!! that's it!! π
configure(ConfDir) -> snmp:void()
with
when ConfDir :: string().
this one gets called from the supervisor at system start-up, so she's an early riser. π
what she does: inserts all data in the configuration files into the database and destroys all old data. so, like, the data in the SNMP-FRAMEWORK-MIB after this function has been called is from the configuration files. that's it, that's the source of truth now.
all snmp counters are set to zero. zero them out, cleanse the timeline. β¨
β οΈ if an error is found in the configuration file, it gets reported using the functionconfig_err/2of the error report module, and then the function fails with reasonconfiguration_error. so yeah, it will absolutely let you know. π
ConfDir is a string pointing to the directory where the configuration files are found. and the configuration file that gets read is: context.conf. π
delete_context(Key) -> ok | {error, Reason}
with
when Key :: term(), Reason :: term().
deletes a context from the agent config. bye bestie ππ
init() -> snmp:void().
also called from the supervisor at system start-up (she's part of the opening act π¬).
creates the necessary objects in the database if they do not exist. and listen β it does not destroy any old values. so init() is the chill one, and configure/1 is the one who rearranges your whole room while you're gone. π
and that's the whole page bestie!! every flag, every number, every note, all accounted for. π
it's from Ericsson AB, the manual is snmp 5.20.5, and this page is snmp_framework_mib(3) β so if you cite it, cite it right. π
β¨
π¦ 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