SNMPTrap
Use the SNMPTrap library in Lua to receive trap notifications from an SNMP-enabled device.
Note: In the SNMP model, Q-SYS acts as the SNMP Manager, while the device you intend to monitor runs an SNMP Agent that allows for monitoring.
Create a new SNMP trap listener.
Syntax
SNMPTrap.New("trap_name")
Arguments
trap_name : String. The name of the trap listener session.
Example
snmp_trap = SNMPTrap.New("snmp_trap")
Begin a trap listening session.
Assign a Lua callback for successful SNMP events.
Requests
RequestID : Integer. The request ID for bookkeeping purposes.
OID : String. The object ID for the response.
Value : String. The string representation for the current state of the object ID.
HostName : String. The host name for the response.
Example
snmp_object.EventHandler = function(response)
print(response.OID)
print(response.Value)
end
Assign a Lua callback for unsuccessful SNMP events.
Requests
Error : String. The error message for the request.
Example
snmp_object.ErrorHandler = function(response)
print(response.Error)
end