User's Guide
Reference Manual
Release Notes
PDF
Top

Simple Network Management Protocol (SNMP)
Reference Manual
Version 4.22

Expand All
Contract All

Table of Contents

- snmp
  - Top of manual page
  - config/0
  - start/0
  - start/1
  - start_agent/0
  - start_agent/1
  - start_manager/0
  - start_manager/1
  - date_and_time/0
  - date_and_time_to_universal_time_dst/1
  - date_and_time_to_string/1
  - date_and_time_to_string/2
  - date_and_time_to_string2/1
  - local_time_to_date_and_time_dst/1
  - universal_time_to_date_and_time/1
  - validate_date_and_time/1
  - validate_date_and_time/2
  - passwd2localized_key/3
  - octet_string_to_bits/1
  - bits_to_octet_string/1
  - read_mib/1
  - log_to_txt/5
  - log_to_txt/6
  - log_to_txt/7
  - log_to_io/4
  - log_to_io/5
  - log_to_io/6
  - change_log_size/2
  - print_version_info/0
  - print_version_info/1
  - versions1/0
  - versions2/0
  - print_versions/1
  - print_versions/2
  - enable_trace/0
  - disable_trace/0
  - set_trace/1
  - reset_trace/1
  - set_trace/2
- snmp (App)
- snmpa
  - Top of manual page
  - add_agent_caps/2
  - del_agent_caps/1
  - get_agent_caps/0
  - get/2
  - get/3
  - get_next/2
  - get_next/3
  - backup/1
  - backup/2
  - info/0
  - info/1
  - old_info_format/1
  - load_mibs/1
  - load_mibs/2
  - unload_mibs/1
  - unload_mibs/2
  - which_mibs/0
  - which_mibs/1
  - whereis_mib/1
  - whereis_mib/2
  - current_request_id/0
  - current_context/0
  - current_community/0
  - current_address/0
  - enum_to_int/2
  - enum_to_int/3
  - int_to_enum/2
  - int_to_enum/3
  - name_to_oid/1
  - name_to_oid/2
  - oid_to_name/1
  - oid_to_name/2
  - which_aliasnames/0
  - which_tables/0
  - which_variables/0
  - which_notifications/0
  - log_to_txt/1
  - log_to_txt/2
  - log_to_txt/3
  - log_to_txt/4
  - log_to_txt/5
  - log_to_txt/6
  - log_to_txt/7
  - log_to_io/1
  - log_to_io/2
  - log_to_io/3
  - log_to_io/4
  - log_to_io/5
  - log_to_io/6
  - change_log_size/1
  - set_log_type/1
  - set_log_type/2
  - mib_of/1
  - mib_of/2
  - me_of/1
  - me_of/2
  - invalidate_mibs_cache/0
  - invalidate_mibs_cache/1
  - enable_mibs_cache/0
  - enable_mibs_cache/1
  - disable_mibs_cache/0
  - disable_mibs_cache/1
  - which_mibs_cache_size/0
  - which_mibs_cache_size/1
  - gc_mibs_cache/0
  - gc_mibs_cache/1
  - gc_mibs_cache/1
  - gc_mibs_cache/2
  - gc_mibs_cache/2
  - gc_mibs_cache/3
  - enable_mibs_cache_autogc/0
  - enable_mibs_cache_autogc/1
  - disable_mibs_cache_autogc/0
  - disable_mibs_cache_autogc/1
  - update_mibs_cache_age/1
  - update_mibs_cache_age/2
  - update_mibs_cache_gclimit/1
  - update_mibs_cache_gclimit/2
  - register_notification_filter/3
  - register_notification_filter/4
  - register_notification_filter/4
  - register_notification_filter/5
  - unregister_notification_filter/1
  - unregister_notification_filter/2
  - which_notification_filter/0
  - which_notification_filter/1
  - set_request_limit/1
  - set_request_limit/2
  - register_subagent/3
  - unregister_subagent/2
  - send_notification2/3
  - send_notification/3
  - send_notification/4
  - send_notification/5
  - send_notification/6
  - send_notification/7
  - discovery/2
  - discovery/3
  - discovery/3
  - discovery/4
  - discovery/4
  - discovery/5
  - discovery/6
  - convert_config/1
  - restart_worker/0
  - restart_worker/1
  - restart_set_worker/0
  - restart_set_worker/1
  - print_mib_info/0
  - print_mib_tables/0
  - print_mib_variables/0
  - verbosity/2
- snmpa_conf
  - Top of manual page
  - agent_entry/2
  - write_agent_config/2
  - write_agent_config/3
  - append_agent_config/2
  - read_agent_config/1
  - standard_entry/2
  - write_standard_config/2
  - write_standard_config/3
  - append_standard_config/2
  - read_standard_config/1
  - context_entry/1
  - write_context_config/2
  - write_context_config/3
  - append_context_config/2
  - read_context_config/1
  - community_entry/1
  - community_entry/5
  - write_community_config/2
  - write_community_config/3
  - append_community_config/2
  - read_community_config/1
  - target_addr_entry/5
  - target_addr_entry/6
  - target_addr_entry/8
  - target_addr_entry/10
  - target_addr_entry/11
  - write_target_addr_config/2
  - write_target_addr_config/3
  - append_target_addr_config/2
  - read_target_addr_config/1
  - target_params_entry/2
  - target_params_entry/4
  - target_params_entry/5
  - write_target_params_config/2
  - write_target_params_config/3
  - append_target_params_config/2
  - read_target_params_config/1
  - vacm_s2g_entry/3
  - vacm_acc_entry/8
  - vacm_vtf_entry/2
  - vacm_vtf_entry/4
  - write_vacm_config/2
  - write_vacm_config/3
  - append_vacm_config/2
  - read_vacm_config/1
  - usm_entry/1
  - usm_entry/13
  - write_usm_config/2
  - write_usm_config/3
  - append_usm_config/2
  - read_usm_config/1
  - notify_entry/3
  - write_notify_config/2
  - write_notify_config/3
  - append_notify_config/2
  - read_notify_config/1
- snmpa_discovery_handler
  - Top of manual page
  - stage1_finish/3
- snmpa_error_report
  - Top of manual page
  - config_err/2
  - user_err/2
- snmpa_error
  - Top of manual page
  - config_err/2
  - user_err/2
- snmpa_error_io
  - Top of manual page
  - config_err/2
  - user_err/2
- snmpa_error_logger
  - Top of manual page
  - config_err/2
  - user_err/2
- snmpa_local_db
  - Top of manual page
  - dump/0
  - match/2
  - print/0
  - print/1
  - print/2
  - table_create/1
  - table_create_row/3
  - table_delete/1
  - table_delete_row/2
  - table_exists/1
  - table_get_row/2
- snmpa_mpd
  - Top of manual page
  - init/1
  - process_packet/6
  - process_packet/7
  - generate_response_msg/5
  - generate_response_msg/6
  - generate_msg/5
  - generate_msg/6
  - discarded_pdu/1
- snmpa_network_interface
  - Top of manual page
  - start_link/4
  - info/1
  - verbosity/2
  - get_log_type/1
  - set_log_type/2
- snmpa_network_interface_filter
  - Top of manual page
  - accept_recv/2
  - accept_send/2
  - accept_recv_pdu/3
  - accept_send_pdu/2
- snmpa_notification_delivery_info_receiver
  - Top of manual page
  - delivery_targets/3
  - delivery_info/4
- snmpa_notification_filter
  - Top of manual page
  - handle_notification/2
- snmpa_supervisor
  - Top of manual page
  - start_sub_sup/1
  - start_master_sup/1
  - start_sub_agent/3
  - stop_sub_agent/1
- snmp_community_mib
  - Top of manual page
  - configure/1
  - reconfigure/1
  - add_community/5
  - add_community/6
  - delete_community/1
- snmp_framework_mib
  - Top of manual page
  - configure/1
  - init/0
  - add_context/1
  - delete_context/1
- snmp_generic
  - Top of manual page
  - get_status_col/2
  - get_status_col/2
  - get_index_types/1
  - get_table_info/2
  - table_func/2
  - table_func/4
  - table_get_elements/3
  - table_next/2
  - table_row_exists/2
  - table_set_elements/3
  - variable_func/2
  - variable_func/3
  - variable_get/1
  - variable_set/2
- snmp_index
  - Top of manual page
  - delete/1
  - delete/2
  - get/2
  - get_last/1
  - get_next/2
  - insert/3
  - key_to_oid/2
  - new/1
- snmp_notification_mib
  - Top of manual page
  - configure/1
  - reconfigure/1
  - add_notify/3
  - delete_notify/1
- snmp_pdus
  - Top of manual page
  - dec_message/1
  - dec_message_only/1
  - dec_pdu/1
  - dec_scoped_pdu/1
  - dec_scoped_pdu_data/1
  - dec_usm_security_parameters/1
  - enc_encrypted_scoped_pdu/1
  - enc_message/1
  - enc_message_only/1
  - enc_pdu/1
  - enc_scoped_pdu/1
  - enc_usm_security_parameters/1
- snmp_standard_mib
  - Top of manual page
  - configure/1
  - inc/1
  - inc/2
  - reconfigure/1
  - reset/0
  - sys_up_time/0
- snmp_target_mib
  - Top of manual page
  - configure/1
  - reconfigure/1
  - set_target_engine_id/2
  - add_addr/10
  - add_addr/11
  - delete_addr/1
  - add_params/5
  - delete_params/1
- snmp_user_based_sm_mib
  - Top of manual page
  - configure/1
  - reconfigure/1
  - add_user/13
  - delete_user/1
- snmp_view_based_acm_mib
  - Top of manual page
  - configure/1
  - reconfigure/1
  - add_sec2group/3
  - delete_sec2group/1
  - add_access/8
  - delete_access/1
  - add_view_tree_fam/4
  - delete_view_tree_fam/1
- snmpc
  - Top of manual page
  - compile/1
  - compile/2
  - is_consistent/1
  - mib_to_hrl/1
- snmpc(command)
- snmpm
  - Top of manual page
  - monitor/0
  - demonitor/1
  - notify_started/1
  - cancel_notify_started/1
  - register_user/3
  - register_user/4
  - register_user_monitor/3
  - register_user_monitor/4
  - unregister_user/1
  - which_users/0
  - register_agent/3
  - unregister_agent/2
  - agent_info/2
  - update_agent_info/3
  - update_agent_info/4
  - which_agents/0
  - which_agents/1
  - register_usm_user/3
  - unregister_usm_user/2
  - usm_user_info/3
  - update_usm_user_info/4
  - which_usm_users/0
  - which_usm_users/1
  - sync_get2/3
  - sync_get2/4
  - sync_get/3
  - sync_get/4
  - sync_get/4
  - sync_get/5
  - sync_get/6
  - async_get2/3
  - async_get2/4
  - async_get/3
  - async_get/4
  - async_get/4
  - async_get/5
  - async_get/6
  - sync_get_next2/3
  - sync_get_next2/4
  - sync_get_next/3
  - sync_get_next/4
  - sync_get_next/4
  - sync_get_next/5
  - sync_get_next/6
  - async_get_next2/3
  - async_get_next2/4
  - async_get_next/3
  - async_get_next/4
  - async_get_next/4
  - async_get_next/5
  - async_get_next/6
  - sync_set2/3
  - sync_set2/4
  - sync_set/3
  - sync_set/4
  - sync_set/4
  - sync_set/5
  - sync_set/6
  - async_set2/3
  - async_set2/4
  - async_set/3
  - async_set/4
  - async_set/4
  - async_set/5
  - async_set/6
  - sync_get_bulk2/5
  - sync_get_bulk2/6
  - sync_get_bulk/5
  - sync_get_bulk/6
  - sync_get_bulk/6
  - sync_get_bulk/7
  - sync_get_bulk/8
  - async_get_bulk2/5
  - async_get_bulk2/6
  - async_get_bulk/5
  - async_get_bulk/6
  - async_get_bulk/6
  - async_get_bulk/7
  - async_get_bulk/8
  - cancel_async_request/2
  - log_to_txt/2
  - log_to_txt/3
  - log_to_txt/4
  - log_to_txt/5
  - log_to_txt/6
  - log_to_txt/7
  - log_to_io/1
  - log_to_io/2
  - log_to_io/2
  - log_to_io/3
  - log_to_io/4
  - log_to_io/5
  - log_to_io/6
  - change_log_size/1
  - set_log_type/1
  - load_mib/1
  - unload_mib/1
  - which_mibs/0
  - name_to_oid/1
  - oid_to_name/1
  - oid_to_type/1
  - backup/1
  - info/0
  - verbosity/2
  - format_reason/1
  - format_reason/2
- snmpm_conf
  - Top of manual page
  - manager_entry/2
  - write_manager_config/2
  - write_manager_config/3
  - append_manager_config/2
  - read_manager_config/1
  - users_entry/1
  - users_entry/2
  - users_entry/3
  - write_users_config/2
  - write_users_config/3
  - append_users_config/2
  - read_users_config/1
  - agents_entry/12
  - write_agents_config/2
  - write_agents_config/3
  - append_agents_config/2
  - read_agents_config/1
  - usm_entry/6
  - usm_entry/7
  - write_usm_config/2
  - write_usm_config/3
  - append_usm_config/2
  - read_usm_config/1
- snmpm_mpd
  - Top of manual page
  - init_mpd/1
  - process_msg/7
  - generate_msg/5
  - generate_response_msg/4
- snmpm_network_interface
  - Top of manual page
  - start_link/2
  - stop/1
  - send_pdu/7
  - inform_response/4
  - note_store/2
  - info/1
  - verbosity/2
  - get_log_type/1
  - set_log_type/2
- snmpm_user
  - Top of manual page
  - handle_error/3
  - handle_agent/5
  - handle_pdu/4
  - handle_trap/3
  - handle_inform/3
  - handle_report/3
- snmpm_network_interface_filter
  - Top of manual page
  - accept_recv/2
  - accept_send/2
  - accept_recv_pdu/3
  - accept_send_pdu/3

# snmpm

### MODULE

snmpm

### MODULE SUMMARY

Interface functions to the SNMP toolkit manager

### DESCRIPTION

The module snmpm contains interface functions to the SNMP manager.

### Common Data Types

The following data types are used in the functions below:

    oid() = [byte()]  -  The oid() type is used to represent an ASN.1 OBJECT IDENTIFIER
    snmp_reply() = {error_status(), error_index(), varbinds()}
    error_status() = noError | atom()
    error_index() = integer()
    varbinds() = [varbind()]
    atl_type() = read | write | read_write
    target_name() = string()  -  Is a unique *non-empty* string
    vars_and_vals() = [var_and_val()]
    var_and_val() = {oid(), value_type(), value()} | {oid(), value()}
    value_type() = o ('OBJECT IDENTIFIER') |
                   i ('INTEGER') |
                   u ('Unsigned32') |
                   g ('Unsigned32') |
                   s ('OCTET SRING') |
                   b ('BITS') |
                   ip ('IpAddress') |
                   op ('Opaque') |
                   c32 ('Counter32') |
                   c64 ('Counter64') |
                   tt ('TimeTicks')
    value() = term()
    community() = string()
    sec_model() = any | v1 | v2c | usm
    sec_name() = string()
    sec_level() = noAuthNoPriv | authNoPriv | authPriv

### EXPORTS

monitor() -> Ref

Types:

Ref = reference()

Monitor the SNMP manager. In case of a crash, the calling (monitoring) process will get a 'DOWN' message (see the erlang module for more info).

demonitor(Ref) -> void()

Types:

Ref = reference()

Turn off monitoring of the SNMP manager.

notify_started(Timeout) -> Pid

Types:

Timeout = integer()
Pid = pid()

Request a notification (message) when the SNMP manager has started.

The Timeout is the time the request is valid. The value has to be greater then zero.

The Pid is the process handling the supervision of the SNMP manager start. When the manager has started a completion message will be sent to the client from this process: {snmpm_started, Pid}. If the SNMP manager was not started in time, a timeout message will be sent to the client: {snmpm_start_timeout, Pid}.

A client application that is dependent on the SNMP manager will use this function in order to be notified of when the manager has started. There are two situations when this is useful:

- During the start of a system, when a client application could start prior to the SNMP manager but is dependent upon it, and therefor has to wait for it to start.

- When the SNMP manager has crashed, the dependent client application has to wait for the SNMP manager to be restarted before it can reconnect.

The function returns the pid() of a handler process, that does the supervision on behalf of the client application. Note that the client application is linked to this handler.

This function is used in conjunction with the monitor function.

cancel_notify_started(Pid) -> void()

Types:

Pid = pid()

Cancel a previous request to be notified of SNMP manager start.

register_user(Id, Module, Data) -> ok | {error, Reason}
register_user(Id, Module, Data, DefaultAgentConfig) -> ok | {error, Reason}

Types:

Id = term()
Module = snmpm_user()
Data = term()
DefaultAgentConfig = [default_agent_config()]
default_agent_config() = {Item, Val}
Item = community | timeout | max_message_size | version | sec_model | sec_name | sec_level
Val = term()
Reason = term()
snmpm_user() = Module implementing the snmpm_user behaviour

Register the manager entity (=user) responsible for specific agent(s).

Module is the callback module (snmpm_user behaviour) which will be called whenever something happens (detected agent, incoming reply or incoming trap/notification). Note that this could have already been done as a consequence of the node config. (see users.conf).

The argument DefaultAgentConfig is used as default values when this user register agents.

The type of Val depends on Item:

    community = string()
    timeout = integer() | snmp_timer()
    max_message_size = integer()
    version = v1 | v2 | v3
    sec_model = any | v1 | v2c | usm
    sec_name = string()
    sec_level = noAuthNoPriv | authNoPriv | authPriv

register_user_monitor(Id, Module, Data) -> ok | {error, Reason}
register_user_monitor(Id, Module, Data, DefaultAgentConfig) -> ok | {error, Reason}

Types:

Id = term()
Module = snmpm_user()
DefaultAgentConfig = [default_agent_config()]
default_agent_config() = {Item, Val}
Item = community | timeout | max_message_size | version | sec_model | sec_name | sec_level
Val = term()
Data = term()
Reason = term()
snmpm_user() = Module implementing the snmpm_user behaviour

Register the monitored manager entity (=user) responsible for specific agent(s).

The process performing the registration will be monitored. Which means that if that process should die, all agents registered by that user process will be unregistered. All outstanding requests will be canceled.

Module is the callback module (snmpm_user behaviour) which will be called whenever something happens (detected agent, incoming reply or incoming trap/notification). Note that this could have already been done as a consequence of the node config. (see users.conf).

The argument DefaultAgentConfig is used as default values when this user register agents.

The type of Val depends on Item:

    community = string()
    timeout = integer() | snmp_timer()
    max_message_size = integer()
    version = v1 | v2 | v3
    sec_model = any | v1 | v2c | usm
    sec_name = string()
    sec_level = noAuthNoPriv | authNoPriv | authPriv

unregister_user(Id) -> ok | {error, Reason}

Types:

Id = term()

Unregister the user.

which_users() -> Users

Types:

Users = [UserId]
UserId = term()

Get a list of the identities of all registered users.

register_agent(UserId, TargetName, Config) -> ok | {error, Reason}

Types:

UserId = term()
Addr = ip_address()
TargetName = target_name()
Config = [agent_config()]
agent_config() = {Item, Val}
Item = engine_id | address | port | community | timeout | max_message_size | version | sec_model | sec_name | sec_level | tdomain
Val = term()
Reason = term()

Explicitly instruct the manager to handle this agent, with UserId as the responsible user.

Called to instruct the manager that this agent shall be handled. This function is used when the user knows in advance which agents the manager shall handle. Note that there is an alternate way to do the same thing: Add the agent to the manager config files (see agents.conf).

TargetName is a non-empty string, uniquely identifying the agent.

The type of Val depends on Item:

    [mandatory] engine_id = string()
    [mandatory] address = ip_address()
    [optional]  port = integer()
    [optional]  tdomain = transportDomainUdpIpv4 | transportDomainUdpIpv6
    [optional]  community = string()
    [optional]  timeout = integer() | snmp_timer()
    [optional]  max_message_size = integer()
    [optional]  version = v1 | v2 | v3
    [optional]  sec_model = any | v1 | v2c | usm
    [optional]  sec_name = string()
    [optional]  sec_level = noAuthNoPriv | authNoPriv | authPriv

Note that if no tdomain is given, the default value, transportDomainUdpIpv4, is used.

Note that if no port is given, the default value is used.

unregister_agent(UserId, TargetName) -> ok | {error, Reason}

Types:

UserId = term()
TargetName = target_name()

Unregister the agent.

agent_info(TargetName, Item) -> {ok, Val} | {error, Reason}

Types:

TargetName = target_name()
Item = atom()
Reason = term()

Retrieve agent config.

update_agent_info(UserId, TargetName, Info) -> ok | {error, Reason}
update_agent_info(UserId, TargetName, Item, Val) -> ok | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
Info = [{item(), item_value()}]
Item = item()
item() = atom()
Val = item_value()
item_value() = term()
Reason = term()

Update agent config. The function update_agent_info/3 should be used when several values needs to be updated atomically.

See function register_agent) for more info about what kind of items are allowed.

which_agents() -> Agents
which_agents(UserId) -> Agents

Types:

UserId = term()
Agents = [TargetName]
TargetName = target_name()

Get a list of all registered agents or all agents registered by a specific user.

register_usm_user(EngineID, UserName, Conf) -> ok | {error, Reason}

Types:

EngineID = string()
UserName = string()
Conf = [usm_config()]
usm_config() = {Item, Val}
Item = sec_name | auth | auth_key | priv | priv_key
Val = term()
Reason = term()

Explicitly instruct the manager to handle this USM user. Note that there is an alternate way to do the same thing: Add the usm user to the manager config files (see usm.conf).

The type of Val depends on Item:

    sec_name = string()
    auth = usmNoAuthProtocol | usmHMACMD5AuthProtocol | usmHMACSHAAuthProtocoltimeout
    auth_key = [integer()]   (length 16 if auth = usmHMACMD5AuthProtocol,
                              length 20 if auth = usmHMACSHAAuthProtocol)
    priv = usmNoPrivProtocol | usmDESPrivProtocol | usmAesCfb128Protocol
    priv_key = [integer()]   (length is 16 if priv = usmDESPrivProtocol | usmAesCfb128Protocol).

unregister_usm_user(EngineID, UserName) -> ok | {error, Reason}

Types:

EngineID = string()
UserName = string()
Reason = term()

Unregister this USM user.

usm_user_info(EngineID, UserName, Item) -> {ok, Val} | {error, Reason}

Types:

EngineID = string()
UsmName = string()
Item = sec_name | auth | auth_key | priv | priv_key
Reason = term()

Retrieve usm user config.

update_usm_user_info(EngineID, UserName, Item, Val) -> ok | {error, Reason}

Types:

EngineID = string()
UsmName = string()
Item = sec_name | auth | auth_key | priv | priv_key
Val = term()
Reason = term()

Update usm user config.

which_usm_users() -> UsmUsers

Types:

UsmUsers = [{EngineID,UserName}]
EngineID = string()
UsmName = string()

Get a list of all registered usm users.

which_usm_users(EngineID) -> UsmUsers

Types:

UsmUsers = [UserName]
UserName = string()

Get a list of all registered usm users with engine-id EngineID.

sync_get2(UserId, TargetName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get2(UserId, TargetName, Oids, SendOpts) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
Oids = [oid()]
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, ActualReason} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
ReqId = term()
ActualReason = term()
SecInfo = [sec_info()]
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
sec_tag() = atom()
ExpectedValue = ReceivedValue = term()
SnmpInfo = term()

Synchronous get-request.

Remaining is the remaining time of the given (or default) timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. ActualReason is the actual reason in this case.

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

For SnmpInfo, see the user callback function handle_report.

sync_get(UserId, TargetName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get(UserId, TargetName, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get(UserId, TargetName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get(UserId, TargetName, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get(UserId, TargetName, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
ContextName = string()
Oids = [oid()]
Timeout = integer()
ExtraInfo = term()
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
R = term()
SecInfo = [sec_info()]
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
sec_tag() = atom()
ExpectedValue = ReceivedValue = term()
SnmpInfo = term()

Synchronous get-request.

Remaining is the remaining time of the given or default timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. R is the actual reason in this case.

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

For SnmpInfo, see the user callback function handle_report.

async_get2(UserId, TargetName, Oids) -> {ok, ReqId} | {error, Reason}
async_get2(UserId, TargetName, Oids, SendOpts) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
Oids = [oid()]
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
ReqId = term()
Reason = term()

Asynchronous get-request.

The reply, if it arrives, will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The send option timeout specifies for how long the request is valid (after which the manager is free to delete it).

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

async_get(UserId, TargetName, Oids) -> {ok, ReqId} | {error, Reason}
async_get(UserId, TargetName, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
async_get(UserId, TargetName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get(UserId, TargetName, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get(UserId, TargetName, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
ContextName = string()
Oids = [oid()]
Expire = integer()
ExtraInfo = term()
ReqId = term()
Reason = term()

Asynchronous get-request.

The reply, if it arrives, will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The Expire time indicates for how long the request is valid (after which the manager is free to delete it).

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

sync_get_next2(UserId, TargetName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_next2(UserId, TargetName, Oids, SendOpts) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
Oids = [oid()]
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, ActualReason} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
ReqId = term()
ActualReason = term()
SecInfo = [sec_info()]
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
sec_tag() = atom()
ExpectedValue = ReceivedValue = term()
SnmpInfo = term()

Synchronous get-next-request.

Remaining is the remaining time of the given (or default) timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. ActualReason is the actual reason in this case.

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

For SnmpInfo, see the user callback function handle_report.

sync_get_next(UserId, TargetName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_next(UserId, TargetName, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_next(UserId, TargetName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_next(UserId, TargetName, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_next(UserId, TargetName, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
ContextName = string()
Oids = [oid()]
Timeout = integer()
ExtraInfo = term()
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
R = term()

Synchronous get-next-request.

Remaining time of the given or default timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. R is the actual reason in this case.

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

async_get_next2(UserId, TargetName, Oids) -> {ok, ReqId} | {error, Reason}
async_get_next2(UserId, TargetName, Oids, SendOpts) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
Oids = [oid()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
ReqId = integer()
Reason = term()

Asynchronous get-next-request.

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The send option timeout specifies for how long the request is valid (after which the manager is free to delete it).

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

async_get_next(UserId, TargetName, Oids) -> {ok, ReqId} | {error, Reason}
async_get_next(UserId, TargetName, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
async_get_next(UserId, TargetName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get_next(UserId, TargetName, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get_next(UserId, TargetName, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
ContextName = string()
Oids = [oid()]
Expire = integer()
ExtraInfo = term()
ReqId = integer()
Reason = term()

Asynchronous get-next-request.

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The Expire time indicates for how long the request is valid (after which the manager is free to delete it).

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

sync_set2(UserId, TargetName, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_set2(UserId, TargetName, VarsAndVals, SendOpts) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
VarsAndVals = vars_and_vals()
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, ActualReason} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
ReqId = term()
ActualReason = term()
SecInfo = [sec_info()]
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
sec_tag() = atom()
ExpectedValue = ReceivedValue = term()
SnmpInfo = term()

Synchronous set-request.

Remaining is the remaining time of the given (or default) timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. ActualReason is the actual reason in this case.

When var_and_val() is {oid(), value()}, the manager makes an educated guess based on the loaded mibs.

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

For SnmpInfo, see the user callback function handle_report.

sync_set(UserId, TargetName, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_set(UserId, TargetName, ContextName, VarsAndVals) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_set(UserId, TargetName, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_set(UserId, TargetName, ContextName, VarsAndVals, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_set(UserId, TargetName, ContextName, VarsAndVals, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
ContextName = string()
VarsAndVals = vars_and_vals()
Timeout = integer()
ExtraInfo = term()
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, ActualReason} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
ActualReason = term()

Synchronous set-request.

Remaining time of the given or default timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. R is the actual reason in this case.

When var_and_val() is {oid(), value()}, the manager makes an educated guess based on the loaded mibs.

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

async_set2(UserId, TargetName, VarsAndVals) -> {ok, ReqId} | {error, Reason}
async_set2(UserId, TargetName, VarsAndVals, SendOpts) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
VarsAndVals = vars_and_vals()
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
ReqId = term()
Reason = term()

Asynchronous set-request.

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The send option timeout specifies for how long the request is valid (after which the manager is free to delete it).

When var_and_val() is {oid(), value()}, the manager makes an educated guess based on the loaded mibs.

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

async_set(UserId, TargetName, VarsAndVals) -> {ok, ReqId} | {error, Reason}
async_set(UserId, TargetName, ContextName, VarsAndVals) -> {ok, ReqId} | {error, Reason}
async_set(UserId, TargetName, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
async_set(UserId, TargetName, ContextName, VarsAndVals, Expire) -> {ok, ReqId} | {error, Reason}
async_set(UserId, TargetName, ContextName, VarsAndVals, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
VarsAndVals = vars_and_vals()
Expire = integer()
ExtraInfo = term()
ReqId = term()
Reason = term()

Asynchronous set-request.

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The Expire time indicates for how long the request is valid (after which the manager is free to delete it).

When var_and_val() is {oid(), value()}, the manager makes an educated guess based on the loaded mibs.

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

sync_get_bulk2(UserId, TragetName, NonRep, MaxRep, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_bulk2(UserId, TragetName, NonRep, MaxRep, Oids, SendOpts) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
NonRep = integer()
MaxRep = integer()
Oids = [oid()]
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, ActualReason} | {invalid_sec_info, SecInfo, SnmpInfo} | term()
ReqId = term()
ActualReason = term()
SecInfo = [sec_info()]
sec_info() = {sec_tag(), ExpectedValue, ReceivedValue}
sec_tag() = atom()
ExpectedValue = ReceivedValue = term()
SnmpInfo = term()

Synchronous get-bulk-request (See RFC1905).

Remaining is the remaining time of the given (or default) timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. ActualReason is the actual reason in this case.

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a option (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

For SnmpInfo, see the user callback function handle_report.

sync_get_bulk(UserId, TragetName, NonRep, MaxRep, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_bulk(UserId, TragetName, NonRep, MaxRep, ContextName, Oids) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_bulk(UserId, TragetName, NonRep, MaxRep, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_bulk(UserId, TragetName, NonRep, MaxRep, ContextName, Oids, Timeout) -> {ok, SnmpReply, Remaining} | {error, Reason}
sync_get_bulk(UserId, TragetName, NonRep, MaxRep, ContextName, Oids, Timeout, ExtraInfo) -> {ok, SnmpReply, Remaining} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
NonRep = integer()
MaxRep = integer()
ContextName = string()
Oids = [oid()]
Timeout = integer()
ExtraInfo = term()
SnmpReply = snmp_reply()
Remaining = integer()
Reason = {send_failed, ReqId, R} | {invalid_sec_info, SecInfo, SnmpInfo} | term()

Synchronous get-bulk-request (See RFC1905).

Remaining time of the given or default timeout time.

When Reason is {send_failed, ...} it means that the net_if process failed to send the message. This could happen because of any number of reasons, i.e. encoding error. R is the actual reason in this case.

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

async_get_bulk2(UserId, TargetName, NonRep, MaxRep, Oids) -> {ok, ReqId} | {error, Reason}
async_get_bulk2(UserId, TargetName, NonRep, MaxRep, Oids, SendOpts) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
NonRep = integer()
MaxRep = integer()
Oids = [oid()]
SendOpts = send_opts()
send_opts() = [send_opt()]
send_opt() = {context, string()} | {timeout, pos_integer()} | {extra, term()} | {community, community()} | {sec_model, sec_model()} | {sec_name, string()} | {sec_level, sec_level()} | {max_message_size, pos_integer()}
ReqId = integer()
Reason = term()

Asynchronous get-bulk-request (See RFC1905).

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The send option timeout specifies for how long the request is valid (after which the manager is free to delete it).

The send option extra specifies an opaque data structure passed on to the net-if process. The net-if process included in this application makes no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing.

Some of the send options (community, sec_model, sec_name, sec_level and max_message_size) are override options. That is, for this request, they override any configuration done when the agent was registered.

async_get_bulk(UserId, TargetName, NonRep, MaxRep, Oids) -> {ok, ReqId} | {error, Reason}
async_get_bulk(UserId, TargetName, NonRep, MaxRep, ContextName, Oids) -> {ok, ReqId} | {error, Reason}
async_get_bulk(UserId, TargetName, NonRep, MaxRep, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get_bulk(UserId, TargetName, NonRep, MaxRep, ContextName, Oids, Expire) -> {ok, ReqId} | {error, Reason}
async_get_bulk(UserId, TargetName, NonRep, MaxRep, ContextName, Oids, Expire, ExtraInfo) -> {ok, ReqId} | {error, Reason}

Types:

UserId = term()
TargetName = target_name()
NonRep = integer()
MaxRep = integer()
ContextName = string()
Oids = [oid()]
Expire = integer()
ExtraInfo = term()
ReqId = integer()
Reason = term()

Asynchronous get-bulk-request (See RFC1905).

The reply will be delivered to the user through a call to the snmpm_user callback function handle_pdu.

The Expire time indicates for how long the request is valid (after which the manager is free to delete it).

ExtraInfo is an opaque data structure passed on to the net-if process. The net-if process included in this application makes, with one exception, no use of this info, so the only use for it in such a configuration (when using the built in net-if) would be tracing. The one usage exception is: Any tuple with snmpm_extra_info_tag as its first element is reserved for internal use.

cancel_async_request(UserId, ReqId) -> ok | {error, Reason}

Types:

UserId = term()
ReqId = term()
Reason = term()

Cancel a previous asynchronous request.

log_to_txt(LogDir, Mibs)
log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason}
log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason}
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile) -> ok | {error, Reason}
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) -> ok | {error, Reason}
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) -> ok | {error, Reason}

Types:

LogDir = string()
Mibs = [MibName]
MibName = string()
OutFile = string()
LogName = string()
LogFile = string()
Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()}
Reason = disk_log_open_error() | file_open_error() | term()
disk_log_open_error() = {LogName, term()}
file_open_error() = {OutFile, term()}

Converts an Audit Trail Log to a readable text file. OutFile defaults to "./snmpm_log.txt". LogName defaults to "snmpm_log". LogFile defaults to "snmpm.log". See snmp:log_to_txt for more info.

log_to_io(LogDir) -> ok | {error, Reason}
log_to_io(LogDir, Mibs) -> ok | {error, Reason}
log_to_io(LogDir, Mibs) -> ok | {error, Reason}
log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason}
log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}
log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}
log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}

Types:

LogDir = string()
Mibs = [MibName]
MibName = string()
LogName = string()
LogFile = string()
Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()}
Reason = disk_log_open_error() | file_open_error() | term()
disk_log_open_error() = {LogName, term()}
file_open_error() = {OutFile, term()}

Converts an Audit Trail Log to a readable format and prints it on stdio. LogName defaults to "snmpm_log". LogFile defaults to "snmpm.log". See snmp:log_to_io for more info.

change_log_size(NewSize) -> ok | {error, Reason}

Types:

NewSize = {MaxBytes, MaxFiles}
MaxBytes = integer()
MaxFiles = integer()
Reason = term()

Changes the log size of the Audit Trail Log. The application must be configured to use the audit trail log function. Please refer to disk_log(3) in Kernel Reference Manual for a description of how to change the log size.

The change is permanent, as long as the log is not deleted. That means, the log size is remembered across reboots.

set_log_type(NewType) -> {ok, OldType} | {error, Reason}

Types:

NewType = OldType = atl_type()
Reason = term()

Changes the run-time Audit Trail log type.

Note that this has no effect on the application configuration as defined by configuration files, so a node restart will revert the config to whatever is in those files.

This function is primarily useful in testing/debugging scenarios.

load_mib(Mib) -> ok | {error, Reason}

Types:

Mib = MibName
MibName = string()
Reason = term()

Load a Mib into the manager. The MibName is the name of the Mib, including the path to where the compiled mib is found. For example,

              Dir = code:priv_dir(my_app) ++ "/mibs/",
              snmpm:load_mib(Dir ++ "MY-MIB").

unload_mib(Mib) -> ok | {error, Reason}

Types:

Mib = MibName
MibName = string()
Reason = term()

Unload a Mib from the manager. The MibName is the name of the Mib, including the path to where the compiled mib is found. For example,

              Dir = code:priv_dir(my_app) ++ "/mibs/",
              snmpm:unload_mib(Dir ++ "MY-MIB").

which_mibs() -> Mibs

Types:

Mibs = [{MibName, MibFile}]
MibName = atom()
MibFile = string()

Get a list of all the mib's loaded into the manager.

name_to_oid(Name) -> {ok, Oids} | {error, Reason}

Types:

Name = atom()
Oids = [oid()]

Transform a alias-name to its oid.

Note that an alias-name is only unique within the mib, so when loading several mib's into a manager, there might be several instances of the same aliasname.

oid_to_name(Oid) -> {ok, Name} | {error, Reason}

Types:

Oid = oid()
Name = atom()
Reason = term()

Transform a oid to its aliasname.

oid_to_type(Oid) -> {ok, Type} | {error, Reason}

Types:

Oid = oid()
Type = atom()
Reason = term()

Retreive the type (asn1 bertype) of an oid.

backup(BackupDir) -> ok | {error, Reason}

Types:

BackupDir = string()

Backup persistent data handled by the manager.

BackupDir cannot be identical to DbDir.

info() -> [{Key, Value}]

Types:

Key = atom()
Value = term()

Returns a list (a dictionary) containing information about the manager. Information includes statistics counters, miscellaneous info about each process (e.g. memory allocation), and so on.

verbosity(Ref, Verbosity) -> void()

Types:

Ref = server | config | net_if | note_store | all
Verbosity = verbosity()
verbosity() = silence | info | log | debug | trace

Sets verbosity for the designated process. For the lowest verbosity silence, nothing is printed. The higher the verbosity, the more is printed.

format_reason(Reason) -> string()
format_reason(Prefix, Reason) -> string()

Types:

Reason = term()
Prefix = integer() | string()

This utility function is used to create a formatted (pretty printable) string of the error reason received from either:

- The Reason returned value if any of the sync/async get/get-next/set/get-bulk functions returns {error, Reason}

- The Reason parameter in the handle_error user callback function.

Prefix should either be an indention string (e.g. a list of spaces) or a positive integer (which will be used to create the indention string of that length).