Functions

monitor() -> Ref

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()

Ref = reference()

Turn off monitoring of the SNMP manager.

notify_started(Timeout) -> Pid

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.

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 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.

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).

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

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}

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}

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,