SNMP_USER_BASED_SM_MIB(3erl)

πŸ“¦
version 25.3.2.8 Β· 4 versions
, in ubuntu noble

πŸ’– NAME πŸ’–

snmp_user_based_sm_mib β€” ok so this is literally the module that handles the Instrumentation Functions for the SNMP-USER-BASED-SM-MIB, plus the functions you use to configure the database. That's the whole vibe. πŸŽ€


✨ DESCRIPTION ✨

So the module snmp_user_based_sm_mib implements the instrumentation functions for the SNMP-USER-BASED-SM-MIB, and it also gives you functions for configuring the database. Two jobs, both slaying. πŸ’…

Heads up though, bestie: authentication has been extended according to RFC 7860 (that's SNMP-USM-HMAC-SHA2-MIB, iykyk). πŸ”₯

And the configuration files? Those are described in the SNMP User's Manual β€” go read that if you're nosy about the file side of things.


🌸 EXPORTS 🌸

πŸ’œ configure(ConfDir) -> void()

Types:

ConfDir = string()

Okay so this one gets called from the supervisor at system start-up. Very main character energy β€” it shows up first. ⭐

Here's the tea on what it does:

  • Inserts all the data from the configuration files into the database, and destroys all the old rows that have StorageType volatile.
  • The rows that get created from the configuration file will have StorageType nonVolatile.
  • All snmp counters are set to zero. Fresh start, clean slate, new era. πŸ¦‹
⚠️ If an error is found 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. So like, it doesn't just casually continue. It fails. Dramatically. 😭

ConfDir is a string that points to the directory where the configuration files live.

The configuration file it reads is: usm.conf.


πŸ¦‹ reconfigure(ConfDir) -> void()

Types:

ConfDir = string()

This is the full-send version, ngl. It inserts all the data from the configuration files into the database and destroys all the old data β€” and yes, that includes the rows with StorageType nonVolatile. No survivors. πŸ’€ The rows created from the configuration file will have StorageType nonVolatile.

So basically: after you call this function, the data in the SNMP-USER-BASED-SM-MIB is the data from the configuration files. Periodt. πŸ‘‘

  • All snmp counters are set to zero here too.
⚠️ Same deal as before β€” if there's an error in the configuration file, it's reported via the function config_err/2 of the error report module, and the function fails with the reason configuration_error.

ConfDir is a string pointing to the directory where the configuration files are found.

The configuration file it reads is: usm.conf.


🧚 add_user(EngineID, Name, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey) -> Ret

Types:

EngineID = string()
Name = string()
SecName = string()
Clone = zeroDotZero | [integer()]
AuthP = usmNoAuthProtocol | usmHMACMD5AuthProtocol |
usmHMACSHAAuthProtocol | usmHMAC128SHA224AuthProtocol |
usmHMAC192SH256AuthProtocol | usmHMAC256SHA384AuthProtocol |
usmHMAC384SHA512AuthProtocol
AuthKeyC = string()
OwnAuthKeyC = string()
PrivP = usmNoPrivProtocol | usmDESPrivProtocol
PrivKeyC = string()
OwnPrivKeyC = string()
Public = string()
AuthKey = string()
PrivKey = string()
Ret = {ok, Key} | {error, Reason}
Key = term()
Reason = term()

This adds a USM security data (user) to the agent config. It's equivalent to writing one single line in the usm.conf file β€” that's it, that's the whole thing. 🌈


πŸ“ delete_user(Key) -> Ret

Types:

Key = term()
Ret = ok | {error, Reason}
Reason = term()

Deletes a USM security data (user) from the agent config. Bye bestie, we hardly knew ye. πŸ™ˆ


Okay that's the whole page!! Obsessed with how much this module does tbh. This was brought to you by Ericsson AB and the snmp 5.13.5 docs β€” go build something iconic with it πŸ’–βœ¨πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from