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

The Snmp Poller does not follow the maxVarBindPerPDU statement

    XMLWordPrintable

    Details

      Description

      the maxvarbinfperpdu snmp agent config allow the opennms platform to instruct the remote agent to send PDU with a max number of varbinds.
      Many snmp agent are not able to support more then a specified number of oids.

      The snmp poller during the polling of nodes with lots of interface will put into the request oid all the oids to get and they can be somethink like 100 or 1000 depending on the node.
      The Snmp Agents are not able to fulfill such request.

      This seems and issue of the snmp4j implementation that should be able to read the agentconfig and then send only maxvarperpdue requests on the get request.
      We set up a workaround for this forcing the snmp poller to poll only "maxvarperpdu" at time. So splitting the request in more then one snmp get. But this seems to not work as clearly states in the log where you can find stament like this:
      MaxVarBindsperPdu = 192

      while for sure it is 10! The main reason seems to be the getMaxInterfacePerPdu method that returns a wrong value...the following change should fix the code:

      diff --git a/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/pollable/PollableSnmpInterface.java b/opennms-services/src/main
      index 1544f4a..ce750df 100644
      — a/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/pollable/PollableSnmpInterface.java
      +++ b/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/pollable/PollableSnmpInterface.java
      @@ -71,9 +71,7 @@ public class PollableSnmpInterface implements ReadyRunnable {
      private String m_criteria;

      private SnmpAgentConfig m_agentConfig;

      • private int maxInterfacePerPdu = 0;
      • +
        public class SnmpMinimalPollInterface {

      final static int IF_UP=1;
      @@ -438,7 +436,7 @@ public class PollableSnmpInterface implements ReadyRunnable {
      }

      private ThreadCategory log()

      { - return ThreadCategory.getInstance(PollableService.class); + return ThreadCategory.getInstance(PollableSnmpInterface.class); }

      /**
      @@ -483,17 +481,7 @@ public class PollableSnmpInterface implements ReadyRunnable {

      • @return a int.
        */
        public int getMaxInterfacePerPdu() { - return maxInterfacePerPdu; + return getAgentConfig().getMaxVarsPerPdu(); }

        -

      • /**
      • * <p>Setter for the field <code>maxInterfacePerPdu</code>.</p>
      • *
      • * @param maxInterfacePerPdu a int.
      • */
      • public void setMaxInterfacePerPdu(int maxInterfacePerPdu) { - this.maxInterfacePerPdu = maxInterfacePerPdu; - }

        -
        }

      Here you see that we redefine in the right manner the code to get the proper max interface in the pdus using the maxvarbindperpdu and remove the unused variable private int maxInterfacePerPdu = 0

        Attachments

          Activity

            People

            • Assignee:
              rssntn67 Antonio Russo
              Reporter:
              rssntn67 Antonio Russo
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: