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

Scriptd helpers ignore community setting

    XMLWordPrintable

Details

    • Horizon 22 - March 16 - 30
    • Backlog CM
    • 994

    Description

      A simplified config to reproduce:

      <scriptd-configuration xmlns="http://xmlns.opennms.org/xsd/config/scriptd" transactional="false">
         <engine language="beanshell" className="bsh.util.BeanShellBSFEngine" extensions="bsh"/>
      
         <start-script language="beanshell"><![CDATA[
          log = bsf.lookupBean("log");
      
          snmpTrapHelper = new org.opennms.netmgt.scriptd.helper.SnmpTrapHelper();
          snmpv2TrapHelper = new org.opennms.netmgt.scriptd.helper.SnmpV2TrapEventForwarder(
                "someInternalHost", /* ip */
                162, /* port */
                "TestTestTest", /*community */
                snmpTrapHelper /* helper */
          );
          snmpv2TrapHelper.setEventPolicyRule(new org.opennms.netmgt.scriptd.helper.EventPolicyRuleDefaultImpl());
         ]]>
         </start-script>
      
         <stop-script language="beanshell">
          snmpTrapHelper.stop();
         </stop-script>
      
         <event-script language="beanshell"><![CDATA[
          org.opennms.netmgt.events.api.model.IEvent immutableEvent = bsf.lookupBean("event");
          org.opennms.netmgt.xml.event.Event newEvent =  org.opennms.netmgt.xml.event.Event.copyFrom(immutableEvent);
          log.debug(newEvent.toString());
          snmpv2TrapHelper.flushEvent(newEvent);
         ]]>
         </event-script>
      
      </scriptd-configuration>
      

      Every forwarded trap is set to community "public":

      Attachments

        Activity

          People

            amay Alex May
            dino2gnt Dino Yancey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: