SNMP interface poller filtering not allowing data collection after provisioning group sync
Description
Environment
Acceptance / Success Criteria
Attachments
Lucidchart Diagrams
Activity
Antonio Russo October 13, 2011 at 1:43 AM
I can confirm that this is fixed in 1.8 and 1.9.92! I made changes so that the snmp poller does not change anything else then the admin status, oper status and snmppollpastpoll time.
Eric W Abrahamsen October 12, 2011 at 8:48 PM
Hi Antonio,
Can you confirm this bug was fixed in 1.8.15 and 1.9.92? I was unable to find this in either of the release notes.
Thanks,
-Eric
Antonio Russo September 18, 2011 at 12:48 PM
Fixing in 1.8:
commit 12f5c1b060da67975040e1c9dc39c57fdc88e0b2
Author: Antonio <rssntn67@yahoo.it>
Date: Sun Sep 18 18:43:09 2011 +0200
Antonio Russo September 17, 2011 at 10:20 AM
Who delete the interface is the Provisiond but the issue is because the snmp poller updates the last node scan with a wrong value.
In practice after a node is provisioned or rescanned the provisiond update the node last scan for every interface found on the node, and then deletes all the interface (snmpinterface) onto database that have a snmp last scan time lesser then the one it has updated.
What happens is that the snmp poller can poll an interface during the rescan phase and will update the last scan with a wrong value. So at the end of the scan phase the provision found the interface with the wrong last scan updated by the snmp poller and delete it.
I fixed this issue in 1.10 and master but I have not fixed yet this in 1.8.
here is the fix:
diff --git a/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/DefaultPollContext.java b/opennms-services/src/main/java/org/op
index 273c2e8..d2458f1 100644
— a/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/DefaultPollContext.java
+++ b/opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/DefaultPollContext.java
@@ -225,7 +225,16 @@ public class DefaultPollContext implements PollContext {
/** {@inheritDoc} */
public void update(OnmsSnmpInterface snmpinterface) {
getSnmpInterfaceDao().update(snmpinterface);
+ OnmsSnmpInterface dbSnmpInterface = getSnmpInterfaceDao().findByNodeIdAndIfIndex(snmpinterface.getNode().getId(), snmpinterface.getIfInde
+ if (dbSnmpInterface == null) {
+ log().debug("updating SnmpInterface: no interface found on db for: " + snmpinterface.toString());
+ } else {
+ dbSnmpInterface.setIfOperStatus(snmpinterface.getIfOperStatus());
+ dbSnmpInterface.setIfAdminStatus(snmpinterface.getIfAdminStatus());
+ dbSnmpInterface.setLastSnmpPoll(snmpinterface.getLastSnmpPoll());
+ log().debug("updating SnmpInterface: " + dbSnmpInterface.toString());
+ getSnmpInterfaceDao().update(dbSnmpInterface);
+ }
}
I changed the update method to update the interface retrieved by the database directly and as you can see I only update the Admin, Oper status and the "LastSnmpPoll" time!
Just testing and running tests!
Eric W Abrahamsen May 27, 2011 at 4:14 PM
I could not tell exactly what was deleting it other than it being done via a provisioning group sync but a manual rescan corrected it. I did try looking through debugs of the provisiond and snmpinterface logs but everything seemed normal. I didn't get logs showing something was being deleted. If you have a different place to look I would be glad to see if anything is showing up there. In my scenario if the snmp interface poller was configured with the filter I could not even manually change the data collect via the gui to "C" as it would just revert a few seconds later.
-Eric
Details
Details
Assignee
Reporter
Labels
Fix versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty

I found possible scenario where filtering causes an issue where after a provisioning sync with the database if the filter matches the L2/L3 interface it is deleted from the database when using filtering with the snmp interface poller. If I do a manual scan the L3 interface will re-populate into the database without an IP address and unable to collect data even if is provisioned as a secondary interface. Something with the provisioning sync is conflicting with the filtering being done. Doing a debug of the provisiond.log during a rescan or sync show no errors/exceptions.
Here is the example configuration for the snmp-interface-poller:
-Eric