This chapter describes the snmp
application in OTP. The SNMP application provides the following
services:
The following configuration parameters are defined for the SNMP application. Refer to application(3) for more information about configuration parameters.
A minimal config file for starting a node with both a manager and an agent:
[{snmp,
[{agent, [{db_dir, "/tmp/snmp/agent/db"},
{config, [{dir, "/tmp/snmp/agent/conf"}]}]},
{manager, [{config, [{dir, "/tmp/snmp/manager/conf"},
{db_dir, "/tmp/snmp/manager/db"}]}]}]}
]
}
].
agent = [agent_opt()]
agent_opt() = {agent_type, agent_type()} |
{agent_verbosity, verbosity()} |
{versions, versions()} |
{priority, priority()} |
{multi_threaded, multi_threaded()} |
{db_dir, db_dir()} |
{local_db, local_db()} |
{net_if, net_if()} |
{mibs, mibs()} |
{mib_storage, mib_storage()} |
{mib_server, mib_server()} |
{audit_trail_log, audit_trail_log()} |
{error_report_mod, error_report_mod()} |
{note_store, note_store()} |
{symbolic_store, symbolic_store()} |
{config, agent_config()}
manager = [manager_opt()]
manager_opt() = {net_if, manager_net_if()} |
{server, server()} |
{note_store, note_store()} |
{config, manager_config()} |
{mibs, manager_mibs()} |
{priority, priority()} |
{audit_trail_log, audit_trail_log()} |
{versions, versions() |
{def_user_module, def_user_module() |
{def_user_data, def_user_data()}
Agent specific config options and types:
agent_type() = master | sub <optional>
master, one master agent is
started. Otherwise, no agents are started.
master.
multi_threaded() = bool() <optional>
true, the agent is multi-threaded, with one
thread for each get request.
false.
db_dir() = string() <mandatory>
local_db() = [local_db_opt()] <optional>
local_db_opt() = {repair, agent_repair()} |
{auto_save, agent_auto_save()} |
{verbosity, verbosity()}
local_db_opt().
agent_repair() = false | true | force <optional>
false, and some errors occur, a new
database is created instead. If true, an existing file
will be repaired. If force, the table will be repaired
even if it was properly closed.
true.
agent_auto_save() = integer() | infinity <optional>
5000.
agent_net_if() = [agent_net_if_opt()] <optional>
agent_net_if_opt() = {module, agent_net_if_module()} |
{verbosity, verbosity()} |
{options, agent_net_if_options()}
agent_net_if_opt().
agent_net_if_module() = atom() <optional>
snmpa_net_if.
agent_net_if_options() = [agent_net_if_option()] <optional>
agent_net_if_option() = {bind_to, bind_to()} |
{recbuf, recbuf()} |
{no_reuse, no_reuse()} |
{req_limit, req_limit()}
agent_net_if_module().
agent_net_if_option().
req_limit() = integer() | infinity <optional>
infinity.
agent_mibs() = [string()] <optional>
STANDARD-MIB
SNMPv2
SNMPv2, SNMP-FRAMEWORK-MIB
and SNMP-MPD-MIB
[].
mib_storage() = ets | {dets,Dir} | {dets,Dir,Action} | {mnesia,Nodes} | {mnesia,Nodes,Action} <optional>
ets.
Dir = string(). Dir is the directory where the (dets)
files will be created.
Nodes = [node()]. If Nodes = [] then the own node
is assumed.
Action = clear | keep. Default is keep.
Action is used to specify what shall be done if the mnesia
table already exist.
mib_server() = [mib_server_opt()] <optional>
mib_server_opt() = {mibentry_override, mibentry_override()} |
{trapentry_override, trapentry_override()} |
{verbosity, verbosity()}
mib_server_opt().
mibentry_override() = bool() <optional>
false.
trapentry_override() = bool() <optional>
false.
error_report_mod() = atom() <optional>
snmpa_error_logger and snmpa_error_io.
snmpa_error_logger.
symbolic_store() = [symbolic_store_opt()]
symbolic_store_opt() = {verbosity, verbosity()}symbolic_store_opt().
agent_config() = [agent_config_opt()] <mandatory>
agent_config_opt() = {dir, agent_config_dir()} |
{force_load, force_load()} | {verbosity, verbosity()}
agent_config_opt().
agent_config_dir = dir() <mandatory>
force_load() = bool() <optional>
true the configuration files are re-read
during startup, and the contents of the configuration
database ignored. Thus, if true, changes to
the configuration database are lost upon reboot of the
agent. false.Manager specific config options and types:
server() = [server_opt()] <optional>
server_opt() = {timeout, server_timeout()} |
{verbosity, verbosity()}
silence.
server_timeout() = integer() <optional>
server_timeout() time.
The information will have an best before time,
defined by the Expire time given when calling the
request function (see ag,
agn and
as).
30000.
manager_config() = [manager_config_opt()] <mandatory>
manager_config_opt() = {dir, manager_config_dir()} |
{db_dir, manager_db_dir()} | {repair, manager_repair()} |
{verbosity, verbosity()}
manager_config_opt().
manager_config_dir = dir() <mandatory>
manager_db_dir = dir() <mandatory>
manager_repair() = false | true | force <optional>
true.
manager_auto_save() = integer() | infinity <optional>
5000.
manager_mibs() = [string()] <optional>
[].
manager_net_if() = [manager_net_if_opt()] <optional>
manager_net_if_opt() = {module, manager_net_if_module()} |
{verbosity, verbosity()} |
{options, manager_net_if_options()}
manager_net_if_opt().
manager_net_if_options() = [manager_net_if_option()] <optional>
manager_net_if_option() = {recbuf, recbuf()} |
{bind_to, bind_to()} |
{no_reuse, no_reuse()}
manager_net_if_module().
manager_net_if_option().
manager_net_if_module() = atom() <optional>
snmpm_net_if.
def_user_module() = atom() <optional>
snmpm_user_default.
def_user_data() = term() <optional>
undefined.
Common config types:
priority() = atom() <optional>
normal.
versions() = [version()] <optional>
version() = v1 | v2 | v3
[v1,v2,v3].
verbosity() = silence | info | log | debug | trace <optional>
silence.
bind_to() = bool() <optional>
true, net_if binds to the IP adress.
If false, net_if listens on any IP address on the host
where it is running.
false.
no_reuse() = bool() <optional>
true, net_if does not specify that the IP
and port address should be reusable. If false,
the address is set to reusable.
false.
recbuf() = integer() <optional>
gen_udp.
note_store() = [note_store_opt()] <optional>
note_store_opt() = {timeout, gc_timeout()} |
{verbosity, verbosity()}
silence.
gc_timeout() = integer() <optional>
timeout the note_store
process performs a GC to remove the expired note's. Time in
milli-seconds.
30000.
audit_trail_log() = [audit_trail_log_opt()] <optional>
audit_trail_log_opt() = {type, atl_type()} |
{dir, atl_dir()} |
{size, atl_size()} |
{repair, atl_repair()}
disk_log module is used
to maintain a wrap log. If present, the dir and
size options are mandatory.
atl_type() = read | write | read_write <optional>
write is specified, only set requests are logged.
read is specified, only get requests are logged.
read_write, all requests are logged.
write is specified, only sent messages are logged.
read is specified, only received messages are logged.
read_write, both outgoing and incomming messages are
logged.
read_write.
atl_dir = dir() <mandatory>
audit_trail_log specifies that logging should take
place, this parameter must be defined.
atl_size() = {integer(), integer()} <mandatory>
disk_log.
audit_trail_log specifies that logging should
take place, this parameter must be defined.
atl_repair() = true | false | truncate <optional>
disk_log.
true.
application(3), disk_log(3)