Skip to content

SendSnmpTraps

Sending SNMP Trap#

Overview#

This integration sends out SNMP traps to a SNMP trap receiver.

Configure the channel#

Go in Configuration Management

image

Go in Alert Channel, and hit the + button.

image

Select the snmptrap template . Select the Analytic Engine on which you want this configuration to be deployed; and provide a Configuration Name that is meaningful for you. The Description is optional.

  [snmptrap]
  enabled = true
  addr = "your_trap_receiver:162"
  community = "public"
  retries = 1

Enter the IP address of your trap receiver host.

Once done, click Apply. Your Channel is ready.

Configure your Alert Definitions#

Go in Alert Definitions, and edit the configuration(s) for which you want SNMP trap notification.

image

Add the snmptrap action. The example below will send a Unryo SNMP Trap. However, you can choose instead to use another trap oid.

  .snmpTrap('1.3.6.1.4.1.202020.1.1.1')
    .data('1.3.6.1.4.1.202020.1.1.1.1', 's', '{{ .Name }}')
    .data('1.3.6.1.4.1.202020.1.1.1.2', 's', '{{ .idvar }}')
    .data('1.3.6.1.4.1.202020.1.1.1.3', 's', '{{ .Measurement }}')
    .data('1.3.6.1.4.1.202020.1.1.1.4', 's', '{{ .Eventname }}')
    .data('1.3.6.1.4.1.202020.1.1.1.5', 's', '{{index .Tags "resource"}}')
    .data('1.3.6.1.4.1.202020.1.1.1.6', 's', '{{index .Tags "resource_type"}}')
    .data('1.3.6.1.4.1.202020.1.1.1.7', 's', '{{index .Tags "technology"}}')
    .data('1.3.6.1.4.1.202020.1.1.1.8', 's', '{{ .Eventtext }}')
    .data('1.3.6.1.4.1.202020.1.1.1.9', 's', '{{ .Details }}')
    .data('1.3.6.1.4.1.202020.1.1.1.10', 's', '{{ .Category }}')
    .data('1.3.6.1.4.1.202020.1.1.1.11', 's', '{{ .Eventtype }}')
    .data('1.3.6.1.4.1.202020.1.1.1.12', 's', '{{ .Parttype }}')
    .data('1.3.6.1.4.1.202020.1.1.1.13', 's', '{{ .Part }}')
    .data('1.3.6.1.4.1.202020.1.1.1.14', 's', '{{index .Fields "value"}}')
    .data('1.3.6.1.4.1.202020.1.1.1.15', 's', '{{ .Unit }}')
    .data('1.3.6.1.4.1.202020.1.1.1.16', 's', '{{ .triggerType }}')
    .data('1.3.6.1.4.1.202020.1.1.1.17', 's', '{{ .Level }}')
    .data('1.3.6.1.4.1.202020.1.1.1.18', 's', '{{ .Duration }}')
    .data('1.3.6.1.4.1.202020.1.1.1.19', 's', '')
    .data('1.3.6.1.4.1.202020.1.1.1.20', 's', '')
    .data('1.3.6.1.4.1.202020.1.1.1.21', 's', '')
    .data('1.3.6.1.4.1.202020.1.1.1.22', 's', '')
    .data('1.3.6.1.4.1.202020.1.1.1.23', 's', '')

The Unryo SNMP trap contains 23 variables. You can keep the section as-is since variables are already set. Or you can customize it, for example populating the user-defined fields. The table below explains the Unryo SNMP Trap format.

Variable OID Variable Name Description
1.3.6.1.4.1.202020.1.1.1.1 id The ID (or name) of the Unryo alert.
1.3.6.1.4.1.202020.1.1.1.2 idvar The IdVar of the Unryo alert.
1.3.6.1.4.1.202020.1.1.1.3 measurement The measurement
1.3.6.1.4.1.202020.1.1.1.4 eventname The display name of the alert.
1.3.6.1.4.1.202020.1.1.1.5 resource The resource that the alert occurred on.
1.3.6.1.4.1.202020.1.1.1.6 resourcetype The resource type that the alert occurred on.
1.3.6.1.4.1.202020.1.1.1.7 technology The technology that the alert occurred on.
1.3.6.1.4.1.202020.1.1.1.8 eventtext A short description information about the alert.
1.3.6.1.4.1.202020.1.1.1.9 eventdetails A long description information about the alert.
1.3.6.1.4.1.202020.1.1.1.10 category The category of the alert.
1.3.6.1.4.1.202020.1.1.1.11 eventtype The type of the alert, DURABLE or MOMENTARY.
1.3.6.1.4.1.202020.1.1.1.12 parttype The resource part type that the alert occurred on, INTERFACE, PROCESSOR, ...
1.3.6.1.4.1.202020.1.1.1.13 part The part that the alert occurred on, Ethernet0, Ethernet1, ...
1.3.6.1.4.1.202020.1.1.1.14 value The value of the metric that caused the alert.
1.3.6.1.4.1.202020.1.1.1.15 unit The unit of the metric that triggered the alarm.
1.3.6.1.4.1.202020.1.1.1.16 triggertype The trigger type of the alarm, THRESHOLD, NOTIFICATION
1.3.6.1.4.1.202020.1.1.1.17 level The level or severity of the alarm.
1.3.6.1.4.1.202020.1.1.1.18 duration The duration of the alert.
1.3.6.1.4.1.202020.1.1.1.19 userdefined1 A custom field that can be used to add information.
1.3.6.1.4.1.202020.1.1.1.20 userdefined2 A custom field that can be used to add information.
1.3.6.1.4.1.202020.1.1.1.21 userdefined3 A custom field that can be used to add information.
1.3.6.1.4.1.202020.1.1.1.22 userdefined4 A custom field that can be used to add information.
1.3.6.1.4.1.202020.1.1.1.23 userdefined5 A custom field that can be used to add information.

The UNRYO-MIB#

The UNRYO-ALERTS-MIB (UNRYO-ALERTS-MIB.txt) describes the format of the Unryo SNMP trap. You can supply this MIB to the third party trap receiver, so it will be able to translate the Unryo traps.

The Unryo Mib file is accessible here

Send Test#

You can test the notification to make sure it’s translated correctly by the third party trap receiver, by executing this command from your Unryo collector:

snmptrap -v2c -c public 172.23.0.4 '' .1.3.6.1.4.1.202020.1.1.1 .1.3.6.1.4.1.202020.1.1.1.8 s "this is the eventtext description" .1.3.6.1.4.1.202020.1.1.1.19 s "this is the user defined 1"