snmp_standard_mib(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– 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/2 of the error report module, and then the function fails with the reason configuration_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/2 of the error report module, and the function fails with the reason configuration_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 with configuration_error and report through config_err/2. Keep standard.conf clean 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