SNMP_USER_BASED_SM_MIB(3erl)
π 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 functionconfig_err/2of the error report module β and then the function fails with the reasonconfiguration_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 functionconfig_err/2of the error report module, and the function fails with the reasonconfiguration_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
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms