| SNMP(Application) | Ericsson AB | SNMP(Application) |
NAME
SNMP Application
DESCRIPTION
Description
This chapter describes the snmp application in OTP. The SNMP application provides the following services:
Configuration
The following configuration parameters are defined for the SNMP application. Refer to application(3) for more information about configuration parameters.
The snmp part of the config file specifying the configuration parameters is basically the following tuple:
-
{snmp, snmp_components_config()}
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"}]}]}]} ] } ].
Each snmp component has its own set of configuration parameters, even though some of the types are common to both components.
-
snmp_components_config() -> [snmp_component_config()] snmp_component_config() -> {agent, agent_options()} | {manager, manager_options()} agent_options() = [agent_option()] agent_option() = {restart_type, restart_type()} | {agent_type, agent_type()} | {agent_verbosity, verbosity()} | {discovery, agent_discovery()} | {versions, versions()} | {gb_max_vbs, gb_max_vbs()} | {priority, priority()} | {multi_threaded, multi_threaded()} | {db_dir, db_dir()} | {db_init_error, db_init_error()} | {local_db, local_db()} | {net_if, agent_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()} | {target_cache, target_cache()} | {config, agent_config()} manager_options() = [manager_option()] manager_option() = {restart_type, restart_type()} | {net_if, manager_net_if()} | {server, server()} | {note_store, note_store()} | {config, manager_config()} | {inform_request_behaviour, manager_irb()} | {mibs, manager_mibs()} | {priority, priority()} | {audit_trail_log, audit_trail_log()} | {versions, versions()} | {def_user_mod, def_user_module() | {def_user_data, def_user_data()}
Agent specific config options and types:
agent_type() = master | sub <optional>
Default is master.
agent_discovery() = [agent_discovery_opt()] <optional>
agent_discovery_opt() = {terminating, agent_terminating_discovery_opts()} | {originating, agent_originating_discovery_opts()}
The terminating options effects discovery initiated by a manager.
The originating options effects discovery initiated by this agent.
For defaults see the options in agent_discovery_opt().
agent_terminating_discovery_opts() = [agent_terminating_discovery_opt()] <optional>
agent_terminating_discovery_opt() = {enable, boolean()} | {stage2, discovery | plain} | {trigger_username, string()}
These are options effecting discovery terminating in this agent (i.e. initiated by a manager).
The default values for the terminating discovery options are:
agent_originating_discovery_opts() = [agent_originating_discovery_opt()] <optional>
agent_originating_discovery_opt() = {enable, boolean()}
These are options effecting discovery originating in this agent.
The default values for the originating discovery options are:
multi_threaded() = bool() | extended <optional>
The value extended means that a special 'process' is also created intended to handle all notifications.
true
If the 'main' worker is busy, a temporary process is spawned to handle that job ('get-request' or notification).
extended
If the 'main' worker is busy, a temporary process is spawned to handle that 'get-request'.
NOTE: Even with multi-threaded set to extended there is still a risk for 'reorder' when sending inform-requsts, which require a response (and may therefore require resending). Also, there is of course no way to guarantee order once the package is on the network.
Default is false.
db_dir() = string() <mandatory>
gb_max_vbs() = pos_integer() | infinity <optional>
Default is 1000.
local_db() = [local_db_opt()] <optional>
local_db_opt() = {repair, agent_repair()} | {auto_save, agent_auto_save()} | {verbosity, verbosity()}
Defines options specific for the SNMP agent local database.
For defaults see the options in local_db_opt().
agent_repair() = false | true | force <optional>
Default is true.
agent_auto_save() = integer() | infinity <optional>
Default is 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()}
Defines options specific for the SNMP agent network interface entity.
For defaults see the options in agent_net_if_opt().
agent_net_if_module() = atom() <optional>
Default is snmpa_net_if.
agent_net_if_options() = [agent_net_if_option()] <optional>
agent_net_if_option() = {bind_to, bind_to()} | {sndbuf, sndbuf()} | {recbuf, recbuf()} | {no_reuse, no_reuse()} | {req_limit, req_limit()} | {filter, agent_net_if_filter_options()} | {open_err_filters, agent_net_if_open_err_filters()} | {extra_sock_opts, extra_socket_options()} | {inet_backend, inet_backend()}
These options are actually specific to the used module. The ones shown here are applicable to the default agent_net_if_module().
NOTE: If the user has configured transports with options then those will take precedence over these options. See agent information for more info.
For defaults see the options in agent_net_if_option().
req_limit() = integer() | infinity <optional>
Default is infinity.
agent_net_if_filter_options() = [agent_net_if_filter_option()] <optional>
agent_net_if_filter_option() = {module, agent_net_if_filter_module()}
These options are actually specific to the used module. The ones shown here are applicable to the default agent_net_if_filter_module().
For defaults see the options in agent_net_if_filter_option().
agent_net_if_filter_module() = atom() <optional>
Default is snmpa_net_if_filter.
agent_net_if_open_err_filters() = [agent_net_if_open_err_filter()] <optional>
agent_net_if_open_err_filter() = atom()
During agent initiation, the transports UDP sockets are opened. If this operation fails, the net-if (and the agent) fails to start (crash). This (filter) list contains error (reasons) that will make net-if fail "nicely". This (filter) list, is supposed to contain errors that can be returned by gen_udp:open/1,2. The effect is that any error returned by gen_udp:open which are in this list, will be considered "non-fatal" and will only result in an info message, rather than an error message. Net If, and the agent, will still crash, but will produce a less obnoxious message.
agent_mibs() = [string()] <optional>
Note that the following mibs will always be loaded:
Default is [].
mib_storage() = [mib_storage_opt()] <optional>
mib_storage_opt() = {module, mib_storage_module()} | {options, mib_storage_options()}
This option specifies how basic mib data is stored. This option is used by two parts of the snmp agent: The mib-server and the symbolic-store.
Default is [{module, snmpa_mib_storage_ets}].
mib_storage_module() = snmpa_mib_data_ets | snmpa_mib_data_dets | snmpa_mib_data_mnesia | module()
Several entities (mib-server via the its data module and the symbolic-store) of the snmp agent uses this for storage of miscellaneous mib related data retrieved while loading a mib.
There are several implementations provided with the agent: snmpa_mib_storage_ets, snmpa_mib_storage_dets and snmpa_mib_storage_mnesia.
Default module is snmpa_mib_storage_ets.
mib_storage_options() = list() <optional>
dir
Also, when a table is opened this file is read, if it exists.
By default, this will not be used.
action
Default is keep.
checksum
Default is false.
dir
Default is keep.
auto_save
Default is default.
repair
Default is false.
action
Default is keep.
nodes
The following distinct values are recognised:
[]
erlang:nodes()
erlang:nodes(visible)
erlang:nodes(connected)
mnesia:system_info(db_nodes)
Default is the result of the call: erlang:nodes().
mib_server() = [mib_server_opt()] <optional>
mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {data_module, mib_server_data_module()}
Defines options specific for the SNMP agent mib server.
For defaults see the options in mib_server_opt().
mibentry_override() = bool() <optional>
Default is false.
trapentry_override() = bool() <optional>
Default is false.
mib_server_data_module() = snmpa_mib_data_tttn | module() <optional>
At present only the default module is provided with the agent, snmpa_mib_data_tttn.
Default module is snmpa_mib_data_tttn.
mibs_cache() = bool() | mibs_cache_opts() <optional>
Default is true (in which case the mibs_cache_opts() default values apply).
mibs_cache_opts() = [mibs_cache_opt()] <optional>
mibs_cache_opt() = {autogc, mibs_cache_autogc()} | {gclimit, mibs_cache_gclimit()} | {age, mibs_cache_age()}
Defines options specific for the SNMP agent mib server cache.
For defaults see the options in mibs_cache_opt().
mibs_cache_autogc() = bool() <optional>
Default is true.
mibs_cache_age() = integer() > 0 <optional>
The age is defined in milliseconds.
Default is 10 timutes.
mibs_cache_gclimit() = infinity | integer() > 0 <optional>
The reason why its possible to set a limit, is that if the cache is large, the GC can potentially take a long time, during which the agent is "busy". But on a heavily loaded system, we also risk not removing enough elements in the cache, instead causing it to grow over time. This is the reason the default value is infinity, which will ensure that all candidates are removed as soon as possible.
Default is infinity.
error_report_mod() = atom() <optional>
Default is snmpa_error_logger.
symbolic_store() = [symbolic_store_opt()]
symbolic_store_opt() = {verbosity, verbosity()}
Defines options specific for the SNMP agent symbolic store.
For defaults see the options in symbolic_store_opt().
target_cache() = [target_cache_opt()]
target_cache_opt() = {verbosity, verbosity()}
Defines options specific for the SNMP agent target cache.
For defaults see the options in target_cache_opt().
agent_config() = [agent_config_opt()] <mandatory>
agent_config_opt() = {dir, agent_config_dir()} | {force_load, force_load()} | {verbosity, verbosity()}
Defines specific config related options for the SNMP agent.
For defaults see the options in agent_config_opt().
agent_config_dir = dir() <mandatory>
force_load() = bool() <optional>
Default is false.
Manager specific config options and types:
server() = [server_opt()] <optional>
server_opt() = {timeout, server_timeout()} | {verbosity, verbosity()} | {cbproxy, server_cbproxy()} | {netif_sup, server_nis()}
Specifies the options for the manager server process.
Default is silence.
server_timeout() = integer() <optional>
Time in milli-seconds.
Default is 30000.
server_cbproxy() = temporary (default) | permanent <optional>
temporary (default)
permanent
Default is temporary.
server_nis() = none (default) | {PingTO, PongTO} <optional>
{PingTO :: pos_integer(), PongTO :: pos_integer()}
The PongTO time specifies how long time the net-if process has to respond to a ping message, with a pong message. Its starts counting when the ping message has been sent.
Both times are in milli seconds.
Default is none.
manager_config() = [manager_config_opt()] <mandatory>
manager_config_opt() = {dir, manager_config_dir()} | {db_dir, manager_db_dir()} | {db_init_error, db_init_error()} | {repair, manager_repair()} | {auto_save, manager_auto_save()} | {verbosity, verbosity()}
Defines specific config related options for the SNMP manager.
For defaults see the options in manager_config_opt().
manager_config_dir = dir() <mandatory>
manager_db_dir = dir() <mandatory>
manager_repair() = false | true | force <optional>
Default is true.
manager_auto_save() = integer() | infinity <optional>
Default is 5000.
manager_irb() = auto | user | {user, integer()} <optional>
auto
See snmpm_network_interface, handle_inform and definition of the manager net if for more info.
Default is auto.
manager_mibs() = [string()] <optional>
Default is [].
manager_net_if() = [manager_net_if_opt()] <optional>
manager_net_if_opt() = {module, manager_net_if_module()} | {verbosity, verbosity()} | {options, manager_net_if_options()}
Defines options specific for the SNMP manager network interface entity.
For defaults see the options in manager_net_if_opt().
manager_net_if_options() = [manager_net_if_option()] <optional>
manager_net_if_option() = {bind_to, bind_to()} | {sndbuf, sndbuf()} | {recbuf, recbuf()} | {no_reuse, no_reuse()} | {filter, manager_net_if_filter_options()} | {extra_sock_opts, extra_socket_options()}} | {inet_backend, inet_backend()}
These options are actually specific to the used module. The ones shown here are applicable to the default manager_net_if_module().
For defaults see the options in manager_net_if_option().
manager_net_if_module() = atom() <optional>
Default is snmpm_net_if.
manager_net_if_filter_options() = [manager_net_if_filter_option()] <optional>
manager_net_if_filter_option() = {module, manager_net_if_filter_module()}
These options are actually specific to the used module. The ones shown here are applicable to the default manager_net_if_filter_module().
For defaults see the options in manager_net_if_filter_option().
manager_net_if_filter_module() = atom() <optional>
Default is snmpm_net_if_filter.
def_user_module() = atom() <optional>
Default is snmpm_user_default.
def_user_data() = term() <optional>
Default is undefined.
Common config types:
restart_type() = permanent | transient | temporary
Default is permanent for the agent and transient for the manager.
db_init_error() = terminate | create | create_db_and_dir
Default is terminate.
priority() = atom() <optional>
Default is normal.
versions() = [version()] <optional>
version() = v1 | v2 | v3
Which SNMP versions shall be accepted/used.
Default is [v1,v2,v3].
verbosity() = silence | info | log | debug | trace <optional>
Default is silence.
bind_to() = bool() <optional>
Default is false.
no_reuse() = bool() <optional>
Default is false.
recbuf() = integer() <optional>
Default value is defined by gen_udp.
sndbuf() = integer() <optional>
Default value is defined by gen_udp.
extra_socket_options() = list() <optional>
This list is not inspected by snmp (other then checking that its a list). Its the users responsibility to ensure that these are valid options and does not conflict with the "normal" options.
Default is [].
inet_backend() = inet | socket <optional>
This option make it possible to use net_if (gen_udp) with a different inet-backend ('inet' or 'socket').
Default is inet.
note_store() = [note_store_opt()] <optional>
note_store_opt() = {timeout, note_store_timeout()} | {verbosity, verbosity()}
Specifies the start-up verbosity for the SNMP note store.
For defaults see the options in note_store_opt().
note_store_timeout() = integer() <optional>
Default is 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()} | {seqno, atl_seqno()}
If present, this option specifies the options for the audit trail logging. The disk_log module is used to maintain a wrap log. If present, the dir and size options are mandatory.
If not present, audit trail logging is not used.
atl_type() = read | write | read_write <optional>
For the agent:
For the manager:
Default is read_write.
atl_dir = dir() <mandatory>
If audit_trail_log specifies that logging should take place, this parameter must be defined.
atl_size() = {integer(), integer()} <mandatory>
If audit_trail_log specifies that logging should take place, this parameter must be defined.
atl_repair() = true | false | truncate | snmp_repair <optional>
Default is true.
atl_seqno() = true | false <optional>
Default is false.
See Also
application(3), disk_log(3)
| 6 | snmp 5.20 |