snmp_notification_mib(3)

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

πŸ’– snmp_notification_mib β€” the Erlang module definition, bestie πŸ’–

okay so this is snmp_notification_mib(3), an Erlang module definition, and no cap it's genuinely iconic once you get what it does.

✨ NAME ✨

snmp_notification_mib β€” the instrumentation functions for SNMP-NOTIFICATION-MIB 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so the module snmp_notification_mib is out here implementing the instrumentation functions for the SNMP-NOTIFICATION-MIB, plus the functions you need to configure the database. it's giving backend main character energy fr fr.

the configuration files? they're described in the SNMP User's Manual, so go check that for the full tea πŸ«–


πŸŽ€ DATA TYPES πŸŽ€

  • notify_name() :: snmp_framework_mib:admin_string(). which is an SnmpAdminString with SIZE(1..32) β€” so like, one to thirty-two characters, keep it cute and short bestie.
  • notify_tag() :: snmp_target_mib:tag_value().
  • notify_type() :: trap | inform. literally just these two options, that's it, that's the vibe.

πŸ’… FUNCTIONS πŸ’…

add_notify(Name, Tag, Type) -> {ok, Key} | {error, Reason}

with the types, exactly like this:

when
    Name :: notify_name(),
    Tag :: notify_tag(),
    Type :: notify_type(),
    Key :: term(),
    Reason :: term().

adds a notify definition to the agent config. it's equivalent to writing exactly one line in the notify.conf file. slay πŸ’–


configure(ConfDir) -> snmp:void()

when ConfDir :: string().

this function gets called from the supervisor at system start-up β€” the supervisor is the one knocking on the door, not you.

it inserts all the data in the configuration files into the database, and it destroys all old rows with StorageType volatile. the rows created from the configuration file will have StorageType nonVolatile. periodt.

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 reason configuration_error. 😭

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

the configuration file read is: notify.conf. πŸ‘‘


delete_notify(Key) -> ok | {error, Reason}

when Key :: term(), Reason :: term().

deletes a notify definition from the agent config. bye boo πŸ‘‹βœ¨


reconfigure(ConfDir) -> snmp:void()

when ConfDir :: string().

inserts all the data in the configuration files into the database and destroys all old data, including the rows with StorageType nonVolatile. the rows created from the configuration file will have StorageType nonVolatile. okay so yeah, it really does wipe the nonVolatile ones too, that's not a typo, that's the whole point. 🫢

thus, the data in the SNMP-NOTIFICATION-MIB, after this function has been called, is from the configuration files. so fresh, so clean.

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 reason configuration_error. πŸ’€

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

the configuration file read is: notify.conf. 🌈


heads up bestie: both configure/1 and reconfigure/1 will fail with reason configuration_error if the config file has a problem, and reconfigure/1 is the one that nukes nonVolatile rows too. read twice, run once. πŸ™ˆ

and that's the whole page, no cap. brought to you by Ericsson AB, version snmp 5.20.5, and this lil page is literally named snmp_notification_mib(3). mwah πŸ’‹ go configure something iconic βœ¨πŸ’–

πŸ“¦ where this page comes from