snmpa_error(3)

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

🌸 snmpa_error β€” NAME πŸ’–

okay so bestie, welcome to snmpa_error, section 3 of the Erlang manual (yes it's an Erlang Module Definition, we're fancy like that) β€” it's literally just functions for reporting SNMP errors. that's the whole vibe. ✨


πŸŽ€ DESCRIPTION πŸŽ€

so like, snmpa_error is this little module that holds two callback functions. they get called whenever an error pops off at different times while your agent is out there doing agent things. 🫢

and here's the cute part β€” these callbacks don't do the reporting themselves. not even a little. they turn around and call the corresponding function in the configured error report module, and that module is the one that actually implements the reporting. like, they're the messenger, the error report module is the main character. periodt. πŸ‘‘

your toolkit ships with two simple implementation(s):

  • snmpa_error_logger β€” this one is the default ⭐
  • snmpa_error_io

and you pick which error report module you want using the error_report_mod directive. peep the configuration parameters for the deets, iykyk. πŸ’…


✨ FUNCTIONS ✨

πŸ¦‹ config_err(Format, Args) -> snmp:void()

config_err(Format, Args) -> snmp:void()
    when
      Format :: string(),
      Args :: list().

this one gets called when something goes wrong during the configuration phase β€” like, classic example, a syntax error got found in a configuration file. 😭 so yeah, if configuring is the problem, this is the function screaming about it.

Format and Args work exactly like they do in io:format(Format, Args). no cap.


🌈 user_err(Format, Args) -> snmp:void()

user_err(Format, Args) -> snmp:void()
    when
      Format :: string(),
      Args :: list().

this one is the run-time girlie. she gets called when a user related error happens while everything's running β€” for example, if a user defined instrumentation function returns erroneous. πŸ’€ yeah. that.

and once again, Format and Args are as in io:format(Format, Args). same energy, different moment. πŸ“


πŸ’œ tiny reminder bestie: both of these are callbacks, so they're just forwarding the drama to whatever module error_report_mod is pointing at. don't get it twisted.

and that's the whole page, bestie!! brought to you by the absolute icons at Ericsson AB, from snmp 5.20.5, filed under snmpa_error(3) β€” slay, stay safe, and may your agents never error out πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from