Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-10475

When using the events:stress command, the node-id or interface passed as parameters are ignored when using jexl

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 23.0.1, Meridian-2018.1.3
    • Fix Version/s: 23.0.2, Meridian-2018.1.4
    • Component/s: OSGi
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - December 5th 2018

      Description

      Let's say I'd like to perform some event stress and execute the command like this:

       events:stress -n 5 -i 192.168.205.10 -u uei.opennms.org/generic/traps/SNMP_Link_Down -j "ifIndex = math:floor(math:random() * 20).intValue()" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.1.' + ifIndex, ifIndex)" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.7.' + ifIndex, 1)" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.8.' + ifIndex, 2)" -j "eb.setIfIndex(ifIndex)" -j

      The generated events are not associated with any node or interface.

      The workaround is using JEXL for everything (including node and interface); for example:

      events:stress -u uei.opennms.org/generic/traps/SNMP_Link_Down -j "ifIndex = math:floor(math:random() * 20).intValue()" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.1.' + ifIndex, ifIndex)" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.7.' + ifIndex, 1)" -j "eb.addParam('.1.3.6.1.2.1.2.2.1.8.' + ifIndex, 2)" -j "eb.setIfIndex(ifIndex)" -j "eb.setService('SNMP')" -j "eb.setNodeid(1)" -j "eb.getEvent().setInterface('172.31.20.7')" 

        Attachments

          Activity

            People

            • Assignee:
              cpape Christian Pape
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: