The Snmp Poller does not follow the maxVarBindPerPDU statement
Description
Environment
Acceptance / Success Criteria
Lucidchart Diagrams
Activity
Antonio Russo January 30, 2012 at 4:13 PM
That is the collectd! Add a new Issue!
Tomás Heredia January 30, 2012 at 3:57 PM
Antonio.. just a question...
I'm having a simillar issue I'm collecting Fortigatye policies traffic with this configuration:
<resourceType name="fgPolicy" label="Fortigate Policy" resourceLabel="Vdom 1 Policy ${index}">
<persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/>
<storageStrategy class="org.opennms.netmgt.dao.support.IndexStorageStrategy"/>
</resourceType>
....
<group name="fortinet-policies" ifType="all">
<mibObj oid=".1.3.6.1.4.1.12356.101.5.1.2.1.1.2.1" instance="fgPolicy" alias="fnFwPolicyPktCount" type="counter" />
<mibObj oid=".1.3.6.1.4.1.12356.101.5.1.2.1.1.3.1" instance="fgPolicy" alias="fnFwPolicyByteCount" type="counter" />
</group>
It collects traffic information for all (numeric) policies.
Because of a bug in the devices, information un bulk responses is wrong, so I need to collect just one var per PDU for this collection.
I tried <snmp-collection name="policies" maxVarsPerPdu="1" snmpStorageFlag="all">, but it seems to collect at least 2 vars per PDU
The only workaround was to set max-vars-per-pdu=1 in snmp-config.xml, with a big performance impact.
<snmp-config xmlns="http://xmlns.opennms.org/xsd/config/snmp" retry="3"
timeout="3000" read-community="public" version="v2c" max-vars-per-pdu="1">
My questions are:
Is this the same issue? or should I report a new one? (I just cannot figure out if this snmp collection is affected by the code corrected in this bug)
Will this be corrected on 1.8.18?
Thank you very much!
Antonio Russo September 18, 2011 at 3:05 PM
Fixed in 1.10:
commit c9a806dd14f534ee1c08988fb771ddc45b4bb0d1
To ssh://rssntn67@opennms.git.sourceforge.net/gitroot/opennms/opennms
21fd620..c9a806d 1.10 -> 1.10
Details
Assignee
Antonio RussoAntonio RussoReporter
Antonio RussoAntonio RussoComponents
Fix versions
Affects versions
Priority
Major
Details
Details
Assignee
Reporter
Components
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

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