snmp_standard_mib(3)
π snmp_standard_mib β the STANDARD-MIB glow-up π
okay bestie, welcome to snmp_standard_mib(3), which is the Erlang module definition page for snmp_standard_mib π This is the one that keeps STANDARD-MIB and SNMPv2-MIB fed and happy, so buckle up.
β¨ NAME β¨
snmp_standard_mib β the instrumentation functions for STANDARD-MIB and SNMPv2-MIB π«Ά
πΈ DESCRIPTION πΈ
So like, this module snmp_standard_mib is the one doing the actual work β it implements the instrumentation functions for the STANDARD-MIB and SNMPv2-MIB, plus it's got the functions you use to configure the database. It's giving backstage crew at the MIB concert, fr fr. π
The configuration files get explained in the SNMP User's Manual β go read that if you want the full lore. β¨
π FUNCTIONS π
π« configure(ConfDir) -> snmp:void() when ConfDir :: string()
This one gets called from the supervisor at system start-up. Very main character entrance, ngl. π¦
Here's what it does, no gatekeeping:
- It inserts all the data from the configuration files into the database, and it destroys all old rows with StorageType
volatile. Bye bestie π - The rows it creates from the configuration file get StorageType
nonVolatileβ they're the ones staying. - All snmp counters get set to zero. Fresh start, periodt.
- If there's an error in the configuration file, it gets reported using the function
config_err/2of the error report module, and then the function fails with the reasonconfiguration_error. π
And ConfDir is a string that points to the directory where the configuration files live.
The configuration file it reads is: standard.conf.
π« inc(Name, N) -> snmp:void() when Name :: atom(), N :: integer()
Increments a variable in the MIB with N β or with one, if N isn't specified. Small bump, big energy. β¨
π« reconfigure(ConfDir) -> snmp:void() when ConfDir :: string()
Okay so this is configure's bolder sibling. π
- It inserts all the data from the configuration files into the database and destroys all old data, including the rows with StorageType
nonVolatile. Yes, even those. Everything. Gone. π«Ά - The rows created from the configuration file will have StorageType
nonVolatile. - So basically, after you call this, the data in the SNMP-STANDARD-MIB and SNMPv2-MIB is from the configuration files. Clean slate, iconic behaviour.
- All snmp counters are set to zero.
- If an error is found in the configuration file, it's reported using the function
config_err/2of the error report module, and the function fails with the reasonconfiguration_error.
And ConfDir, again, is a string pointing to the directory where the configuration files are found.
The configuration file read is: standard.conf.
π« reset() -> snmp:void()
Resets all snmp counters to 0. That's it, that's the whole vibe check. π
π« sys_up_time() -> Time when Time :: integer()
Gets the system up time in hundredth of a second. So like, tiny little slices of seconds β very precise of it. β
heads up bestie: if the config file is messy, things don't just get sad, they literally fail withconfiguration_errorand report throughconfig_err/2. Keepstandard.confclean and we're golden π
and that's the whole page!! brought to you by Ericsson AB, from snmp 5.20.5, dated with the snmp_standard_mib(3) footer energy. mwah π go configure something cute π
π¦ 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