# snmp_supervisor

### MODULE

snmp_supervisor

### MODULE SUMMARY

A supervisor for the SNMP Processes

### DESCRIPTION

The `snmp_supervisor` is the supervisor for the SNMP application. There is always one supervisor at each node with an SNMP agent (master agent or subagent).

### EXPORTS

`start_sub()`
`start_sub(Opts) -> {ok, pid()} | {error, {already_started, pid()}} | {error, Reason}`

Types:

`Opts = [opt()]`
`opt() = {priority, Prio}`

Starts a supervisor for the SNMP agent system without a master agent. The supervisor starts all involved SNMP processes, but no agent processes. Subagents should be started by calling `start_subagent/3`.

`Prio` is an Erlang priority. All SNMP processes use this priority. Default is the same as default in the Erlang runtime system.

`start_master(DbDir,ConfDir)`
`start_master(DbDir,ConfDir,Opts) -> {ok, pid()} | {error, {already_started, pid()}} | {error, Reason}`

Types:

`DbDir = string()`
`ConfDir = string()`
`Opts = [opt()]`
`opt() = {mibs, Mibs} | {net_if, NetIfModule} | {priority, Prio} | {name, Name}`
`Mibs = [MibName]`
`MibName = [string()]`
`NetfModule = atom()`
`Name = {local, atom()} | {global, atom()}`

Starts a supervisor for the SNMP agent system. The supervisor starts all involved SNMP processes, including the master agent. Subagents should be started by calling `start_subagent/3`.

`DbDir` is a string including a trailing directory delimiter, which points to the directory where the database files sre stored.

`ConfDir` is a string including a trailing directory delimiter, which points to the directory where the configuration file is found.

If the STANDARD-MIB is not specified in the `Mibs` list, it is loaded from the configuration directory (i.e. with the `.conf` files).

If no `NetIfModules` is specified, the default net if implementation is used (`snmp_net_if`).

`Prio` is an Erlang priority. All SNMP processes use this priority. Default is the same as default in the Erlang runtime system.

If no `Opts` is given, `[{name, {local, snmp_master_agent}}]` is default.

`start_subagent(ParentAgent,Subtree,Mibs) -> {ok, pid()} | {error, Reason}`

Types:

`ParentAgent = pid()`
`SubTree = oid()`
`Mibs = [MibName]`
`MibName = [string()]`

Starts a subagent on the node where the function is called. The `snmp_supervisor` must be running.

If the supervisor is not running, the function fails with the reason `badarg`.

`stop_subagent(SubAgent) -> ok | no_such_child`

Types:

`SubAgent = pid()`

Stops the subagent on the node where the function is called. The `snmp_supervisor` must be running.

If the supervisor is not running, the function fails with the reason `badarg`.

### AUTHORS

Martin Björklund - support@erlang.ericsson.se
Klas Eriksson - support@erlang.ericsson.se

snmp 3.3.5
Copyright © 1991-2002 Ericsson Utvecklings AB