Types
Agent = pid() | atom()
Notification = atom()
Receiver = no_receiver | {Tag, Recv} | notification_delivery_info()
Tag = term()
Recv = receiver()
receiver() = pid() | atom() | {Mod, Func, Args}
Mod = atom()
Func = atom()
Args = list()
NotifyName = string()
ContextName = string()
Varbinds = varbinds()
varbinds() = [varbind()]
varbind() = {Variable, Value} | {Column, RowIndex, Value} | {OID, Value}
Variable = atom()
Column = atom()
OID = oid()
Value = term()
RowIndex = [int()]
LocalEngineID = string()
Sends the notification Notification to the management targets defined for NotifyName in the snmpNotifyTable in SNMP-NOTIFICATION-MIB from the specified context.
If no NotifyName is specified (or if it is ""), the notification is sent to all management targets (Addresses below).
If no ContextName is specified, the default "" context is used.
The parameter Receiver specifies where information about delivery of Inform-Requests should be sent. The agent sends Inform-Requests and waits for acknowledgments from the managers. Receiver can have three values:
-
no_receiver - No information is delivered.
-
notification_delivery_info() - The information is delivered via a function call according to this data. See the DATA TYPES section above for details.
-
{Tag, Recv} - The information is delivered either via messages or via a function call according to the value of Recv.
If Receiver has the value {Tag, Recv}, the delivery is done according to Recv:
-
pid() | atom() - The info will be delivered in the following messages:
-
{snmp_targets, Tag, Addresses}
This inform the user which target addresses the notification was sent to.
-
{snmp_notification, Tag, {got_response, Address}}
This informs the user that this target address acknowledged the notification.
-
{snmp_notification, Tag, {no_response, Address}}
This informs the user that this target address did not acknowledge notification.
The notification is sent as an Inform-Request to each target address in Addresses and if there are no targets for which an Inform-Request is sent, Addresses is the empty list [].
The receiver will first be sent the snmp_targets message, and then for each address in Addresses list, one of the two snmp_notification messages.
-
{Mod, Func, Args} - The info will be delivered via the function call:
Mod:Func([Msg | Args])
where Msg has the same content and purpose as the messages descrived above.
Address is a management target address and Addresses is a list of management target addresses. They are defined as followes:
Addresses = [address()]
Address = address()
address() = v1_address() | v3_address()
v1_address() = {TDomain, TAddress}
v3_address() = {{TDomain, TAddress}, V3MsgData}
TDomain = tdoamin()
TAddress = taddress()
tdomain() = The oid of snmpUDPDomain
This is the only supported transport domain.
taddress() = [A1, A2, A3, A4, P1, P3]
The 4 first bytes makes up the IP-address and the last 2,
the UDP-port number.
V3MsgData = v3_msg_data()
v3_msg_data() = term()
If Receiver is a notification_delivery_info() record, then the information about the notification delivery will be delivered to the receiver via the callback functions defined by the snmpa_notification_delivery_info_receiver behaviour according to the content of the notification_delivery_info() record.
The optional argument Varbinds defines values for the objects in the notification. If no value is given for an object, the Agent performs a get-operation to retrieve the value.
Varbinds is a list of Varbind, where each Varbind is one of:
-
{Variable, Value}, where Variable is the symbolic name of a scalar variable referred to in the notification specification. -
{Column, RowIndex, Value}, where Column is the symbolic name of a column variable. RowIndex is a list of indices for the specified element. If this is the case, the OBJECT IDENTIFIER sent in the notification is the RowIndex appended to the OBJECT IDENTIFIER for the table column. This is the OBJECT IDENTIFIER which specifies the element. -
{OID, Value}, where OID is the OBJECT IDENTIFIER for an instance of an object, scalar variable, or column variable.
For example, to specify that sysLocation should have the value "upstairs" in the notification, we could use one of:
-
{sysLocation, "upstairs"} or -
{[1,3,6,1,2,1,1,6,0], "upstairs"} or -
{?sysLocation_instance, "upstairs"} (provided that the generated .hrl file is included)
If a variable in the notification is a table element, the RowIndex for the element must be given in the Varbinds list. In this case, the OBJECT IDENTIFIER sent in the notification is the OBJECT IDENTIFIER that identifies this element. This OBJECT IDENTIFIER could be used in a get operation later.
This function is asynchronous, and does not return any information. If an error occurs, user_err/2 of the error report module is called and the notification is discarded.
Note
Note that the use of the LocalEngineID argument is only intended for special cases, if the agent is to "emulate" multiple EngineIDs! By default, the agent uses the value of SnmpEngineID (see SNMP-FRAMEWORK-MIB).
ExtraInfo is not normally used in any way by the agent. It is intended to be passed along to the net-if process, which is a component that a user can implement themself. The users own net-if may then make use of ExtraInfo. The net-if provided with this application does not process ExtraInfo.
There is one exception. Any tuple containing the atom snmpa_default_notification_extra_info will, in this context, be considered belonging to this application, and may be processed by the agent.