snmpa_network_interface(3)

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

✨ snmpa_network_interface ✨

okay bestie, gather round, because this one lives in the snmpa_network_interface corner of the Erlang snmp manual (yes, the Erlang Module Definition one) and it's literally the blueprint for the SNMP agent's network interface πŸ’…


🌸 NAME 🌸

snmpa_network_interface β€” the behaviour module for the SNMP agent network interface. it's giving "contract you must sign", not "library you call". iykyk 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module defines the behaviour of the agent network interface, periodt. if you wanna be a snmpa_network_interface-compliant module, you must export these functions, no skipping:

  • start_link/4
  • info/1
  • get_log_type/1
  • set_log_type/2
  • verbosity/2

what they mean and their exact signatures? all explained below, bestie, don't worry πŸ’–

but β€” and this is the part people forget 😭 β€” that is not enough. there's also a whole set of mandatory messages that the network interface entity has to be able to receive and be able to send. that's described in chapter snmp_agent_netif. go read it, fr fr.


πŸŽ€ CALLBACKS πŸŽ€

πŸ’œ get_log_type(Pid)

the Audit Trail Log is managed by the network interface process. so it is this process that has to retrieve the actual log-type. like, it's the one holding the keys πŸ”‘βœ¨

πŸ’œ get_request_limit(Pid)

the request limit = the number of simultaneous requests the agent will accept. this function retrieves the current value. that's it, that's the whole vibe check 🧚

πŸ’œ info(Pid)

the info returned here is basically up to whoever implements it to decide β€” main character energy, honestly πŸ‘‘

the implementation provided by the application gives you info about memory allocation and various socket information.

and like, that info doesn't just float off into the void: it gets returned together with the other info the agent collects when the info/1 function is called, tagged with the key net_if. slay πŸ’…

πŸ’œ set_log_type(Pid, NewType)

again: the Audit Trail Log is managed by the network interface process, so it's this process that has to do the actual changing of the type. nobody else gets to touch it πŸ™ˆ

see snmpa:set_log_type/2 for more info.

πŸ’œ set_request_limit(Pid, NewLimit)

request limit = the number of simultaneous requests the agent will accept. this function sets a new value. new limit who dis ✨

start-link the network interface process. go, bestie, go πŸƒβ™€οΈπŸ’¨

NoteStore is the pid of the note-store process, and MasterAgent is the pid of the master-agent process.

Opts is a (basically) implementation dependent list of options passed to the network interface process. however, there are a number of options that must be handled: versions and verbosity. not optional, not a suggestion, literally must 🚨

πŸ’œ verbosity(Pid, Verbosity)

change the verbosity of a running network interface process. louder, quieter, whatever you need 🌈


lowkey important reminder: those two required options in start_link/4 (versions and verbosity) are mandatory, and the mandatory-message situation from chapter snmp_agent_netif is real. handle your business 🫢

okay that's the whole page, no cap πŸ’– shoutout to Ericsson AB for this one β€” it's from snmp version 5.20.5, the snmpa_network_interface(3) page, and yeah that's the one. mwah, bye bestie πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from