[SNMP4J] How to remove rows in snmpTargetAddrTable from within the agent?

Martin Carlsson martin.carlsson at transmode.se
Tue Jan 17 17:09:05 CET 2006


Hi there!
I want to configure trap-receivers from within the agent and I've run in
to a problem removing them (adding works fine, was already implemented).
What would be the recommended method to remove rows from within the
agent in the snmpTargetAddr-table?

I tried adding the following method to the target MIB.

 public void removeTargetAddress(OctetString name) {
      OID index = MOTableIndex.createSubIndex(name, true);
      snmpTargetAddrEntryModel.removeRow(index);
  }

Now while this removes the line from the visible (via SNMP that is)
table it seems to still exist in an internal index.
NotificationOriginatorImpl may end up sending traps to the same
destination more than once if the same targetAddrEntry is added again.

      List addresses =
          targetMIB.getTargetAddrRowsForTag(new String(tag.getValue()));

Seems to return multiple entries with the same adress after
adding/removing the same entry a few times.

Any ideas? Alternative methods to do this?

Regards,
/M
---
Martin Carlsson, martin dot carlsson at transmode dot se		
Transmode Systems AB, Jakobsdalsvagen 17, SE-126 53 Hagersten, Sweden	
+46 (0)8 52 76 75 66, Fax: +46 (0)8 52 76 75 99



More information about the SNMP4J mailing list