deleted interfaces are included in polling package ip lists
Description
Creating the problem: Add a node and put it in a polling package via its assets page. Rescan the node and verify that it is polled. Delete the node and re-add it. This time, do not put it in a polling package. Notice that it is polled based on the assets entry for the node that was deleted.
Fix: (this is probably an unacceptable kludge but it illustrates what is needed) in src/services/org/opennms/netmgt/filter/Filter.java, in public List getIPList(String rule), add a line as follows:
// parse the rule and get the sql select statement // sqlString = getSQLStatement(); + sqlString = sqlString + " AND ipInterface.isManaged!='D'"; if (log.isDebugEnabled()) log.debug("Filter: SQL statement: \n" + sqlString);
Environment
Operating System: Linux
Platform: PC
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Benjamin Reed April 22, 2011 at 2:18 PM
This was fixed as part of the work that went on in .
Matt Brozowski April 6, 2011 at 8:08 PM
The patch as described is not correct because it does not take into accout a 'null' value.
(And for this reason tests are now failing)
isManaged != 'D' will exclude one that have isManaged isNull where the original filter will not.
Benjamin Reed April 6, 2011 at 4:42 PM
Until we move the filter rule handling to Hibernate, that does indeed seem to be the best way to do this.
I've gone ahead and committed the fix.
Benjamin Reed October 6, 2008 at 11:52 AM
moving to 1.6.1 target milestone; only things left pending for 1.6.0 are blocker-level bugs
Creating the problem:
Add a node and put it in a polling package via its assets page. Rescan the node
and verify that it is polled. Delete the node and re-add it. This time, do not
put it in a polling package. Notice that it is polled based on the assets entry
for the node that was deleted.
Fix: (this is probably an unacceptable kludge but it illustrates what is needed)
in src/services/org/opennms/netmgt/filter/Filter.java, in
public List getIPList(String rule), add a line as follows:
// parse the rule and get the sql select statement
//
sqlString = getSQLStatement();
+ sqlString = sqlString + " AND ipInterface.isManaged!='D'";
if (log.isDebugEnabled())
log.debug("Filter: SQL statement: \n" + sqlString);