snmpa_supervisor(3)

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

✨ NAME ✨

snmpa_supervisor β€” a supervisor for the SNMP agent Processes πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay bestie, so this is the top supervisor for the agent part of the SNMP application. Like, the big boss energy one. πŸ‘‘

There is always one supervisor at each node with an SNMP agent (master agent or sub-agent). No cap β€” every node that's running an agent has exactly one of these, periodt.


🌸 FUNCTIONS 🌸

start_master_sup(Opts) -> {ok, Pid} | {error, Reason}

start_master_sup(Opts) -> {ok, Pid} | {error, Reason}
                          when
                              Opts :: [Opt],
                              Opt ::
                                  {db_dir, string()} |
                                  {config, ConfOpts} |
                                  {atom(), term()},
                              ConfOpts :: [ConfOpt],
                              ConfOpt ::
                                  {dir, string()} | {atom(), term()},
                              Pid :: pid(),
                              Reason :: {already_started, Pid} | term().

Starts a supervisor for the SNMP agent system πŸŽ€. This one spins up all the involved SNMP processes, including the master agent. Sub-agents? Those don't get auto-started here β€” you gotta call start_subagent/3 yourself. iykyk.

  • db_dir is mandatory. Like, no db_dir, no vibes. πŸ™…β€β™€οΈ
  • dir in config is mandatory too. Both of them. Mandatory. Both.
  • See snmp config for a description of the options πŸ‘€

start_sub_agent(ParentAgent, Subtree, Mibs) -> {ok, Pid} | {error, Reason}

start_sub_agent(ParentAgent, Subtree, Mibs) ->
                         {ok, Pid} | {error, Reason}
                         when
                             ParentAgent :: pid(),
                             Subtree :: snmp:oid(),
                             Mibs :: [MibName],
                             MibName :: string(),
                             Pid :: pid(),
                             Reason :: term().

Starts a sub-agent on the node where the function is called 🌈. Heads up though: the snmpa_supervisor must be running.

If the supervisor is not running, the function fails with the reason badarg. πŸ’€

start_sub_sup(Opts) -> {ok, Pid} | {error, Reason}

start_sub_sup(Opts) -> {ok, Pid} | {error, Reason}
                       when
                           Opts :: [Opt],
                           Opt ::
                               {db_dir, snmp:dir()} | {atom(), term()},
                           Pid :: pid(),
                           Reason :: {already_started, Pid} | term().

Starts a supervisor for the SNMP agent system without a master agent 🧚. So it starts all the involved SNMP agent processes… but no agent processes. Bestie, yes, that is the sentence. Read it again, it's giving exactly what it says. 😭

Sub-agents should be started by calling start_sub_agent/3.

  • db_dir is mandatory. Again. Always. πŸ’–
  • See configuration parameters for a description of the options ✨

stop_sub_agent(SubAgentPid) -> ok | no_such_child

stop_sub_agent(SubAgentPid) -> ok | no_such_child
                        when SubAgentPid :: pid().

Stops the sub-agent on the node where the function is called 🫢. And yep, once again: the snmpa_supervisor must be running.

If the supervisor is not running, the function fails with the reason badarg. πŸ™ˆ

Ericsson AB made this, it's from snmp version 5.20.5, and it's the snmpa_supervisor page (the (3) one, Erlang Module Definition flavour πŸ’œ). That's the whole thing bestie, go start some supervisors, you got this πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from