SNMP Trap: Trigger Node

The SNMP: Trap Trigger will trigger a workflow whenever the Edge Compute Device receives an SNMP trap message or an SNMP inform request on the configured port.

Note: An SNMP trap or inform request received on a given device will also trigger any UDP Triggers listening on the same port.

SNMP Trap Trigger

Node Properties

  • UDP Port: (Required) The UDP Port on which the device should listen for SNMP traps and inform requests.
  • SNMP Version: (Required) Specifies which version or versions of SNMP traps and inform requests should be processed - Versions 1 and 2c, or Version 3.

Version1 and Version2c Configuration

  • Community: (Required) Specifies the SNMP community. Defaults to public.

Version 3 Configuration

  • Username: (Required) The username for the user against which incoming messages should be authenticated.
  • Security Level: (Required) The amount of security for incoming messages. Options are No Authentication or Encryption, Authenticate, No Encryption, and Authenticate and Encrypt.
  • Authentication Method: The protocol to use for authentication. Required if the selected security level requires authentication. Options are SHA or MD5 . Defaults to SHA.
  • Authentication Key: The key to use for decrypting the authentication. Required if the selected security level requires authentication.
  • Encryption Method: The method to use to decrypt the incoming data. Options are DES or AES. Defaults to DES. Required if the selected security level requires encryption.
  • Private Key: The key to use to decrypt the incoming data. Required if the security level requires encryption.

Payload

The payload’s data property is an object containing information about the received message.

  • sourcePort: A number corresponding to the port on which the message was received.
  • sourceAddress: The IP address from which the message originated.
  • message: An object with properties describing the received message. Some of the values may not be present depending on the SNMP version and the nature of the message.
    • community: The community on which the message was received. This matches the “Community” property from the configuration. This property will not be present if the trigger is configured to listen for SNMP Version3 traps and inform messages.
    • username: The username on which the message was received. This matches the “Username” property from the configuration. This property will only be present if the trigger is configured to listen for SNMP Version3 traps and inform messages.
    • version: A string representing the SNMP version (“1”, “2c”, or “3”).
    • pdu: An object representing the protocol data unit (PDU). It contains the following properties:
      • id: A number representing the ID of the message. This will not be present for SNMP Version1 traps.
      • type: The type of message received. This value will either be “Trap” (for Version1), “TrapV2” (for Version2c or Version3), or “InformRequest” (for inform messages).
      • varbinds: An array of objects, each representing a variable binding. This value may not be present. Each object in the array includes the following properties …
        • oid: A string representing the OID from which the variable binding originates.
        • type: An integer that represents the SNMP value type.
        • value: The OID’s value. The shape differs depending on the value of type.

In the general case, the SNMP: Trap workflow payload looks like the following:

{
  "agentEnvironment": {
    "EXAMPLE": "Environment Variable"
  },
  "agentVersion": "1.31.0",
  "applicationId": "555555555555eeeeeeeeeeee",
  "applicationName": "My Great Application",
  "data": {
    "sourcePort": 162,
    "sourceAddress": "192.168.0.1",
    "message": {
      "community": "public",
      "version": "<1|2c|3>",
      "pdu": {
        "id": 234,
        "type": "<Trap|TrapV2|InformRequest>",
        "varbinds": [
          {
            "oid": "1.3.6.1.2.1.1.5.5",
            "type": 4,
            "value": "new snmp alert"
          }
        ]
      }
    }
  },
  "device": {
    "applicationId": "555555555555eeeeeeeeeeee",
    "attributes": {
      "exampleNumber": {
        "attributeTags": {
          "attrTagKey": "tagValue1"
        },
        "dataType": "number",
        "name": "exampleNumber"
      },
      "exampleString": {
        "attributeTags": {
          "attrTagKey": "tagValue2"
        },
        "dataType": "string",
        "name": "exampleString"
      }
    },
    "creationDate": "2018-03-16T18:19:03.376Z",
    "deviceClass": "edgeCompute",
    "deviceId": "222222222222bbbbbbbbbbbb",
    "id": "222222222222bbbbbbbbbbbb",
    "name": "My Great Device",
    "tags": {
      "aTagKey": [
        "exampleTagValue"
      ],
      "tagWithMultipleValues": [
        "tagValue",
        "anotherTagValue"
      ]
    }
  },
  "deviceId": "222222222222bbbbbbbbbbbb",
  "deviceName": "My Great Device",
  "deviceTags": {
    "aTagKey": [
      "exampleTagValue"
    ],
    "tagWithMultipleValues": [
      "tagValue",
      "anotherTagValue"
    ]
  },
  "flowId": "333333333333cccccccccccc",
  "flowName": "My Great Workflow",
  "flowVersion": "myFlowVersion",
  "globals": {
    "aJsonGlobal": {
      "key": "value"
    },
    "aNumberGlobal": 42,
    "aStringGlobal": "My value"
  },
  "isConnectedToLosant": true,
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "triggerId": "<trigger key>",
  "triggerType": "snmpTrap"
}

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.