[SNMP4J] Notification filtering

Houghton, Jack SPAWAR jack.houghton at navy.mil
Thu Feb 2 19:14:43 CET 2006


Hi:
I believe there is one more fix required. 
In SnmpNotificationMIB.passesFilter(), there's the following code
segment:

for (Iterator it = filters.iterator(); it.hasNext(): ) {
   MOTableRow row = (MOTableRow) it.next();
   Variable[] indexValues =
      snmpNotifyEntryIndex.getIndexValues(row.getIndex());
   OID subtree = (OID) indexValues[idxSnmpNotifyFilterSubtree];

Should "snmpNotifyEntryIndex" be replaced with
"snmpNotifyFilterEntryIndex"?

Best Regards,
Jack Houghton

-----Original Message-----
From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
Behalf Of Frank Fock
Sent: Wednesday, February 01, 2006 11:26 PM
To: Matthias Wiesmann
Cc: snmp4j at agentpp.org
Subject: Re: [SNMP4J] Notification filtering


OK, sorry. That's a regression. The index definition should be

  private static MOTableSubIndex[] snmpNotifyEntryIndexes =
    new MOTableSubIndex[] {
        new MOTableSubIndex(SMIConstants.SYNTAX_OCTET_STRING, 1, 32)
  };

  private static MOTableIndex snmpNotifyEntryIndex =
      new MOTableIndex(snmpNotifyEntryIndexes, true);

I probably mixed up snmpNotifyEntry and snmpNotifyFilterEntry when I
tried to fix another problem (I have not tested this code yet).

Best regards,
Frank

Matthias Wiesmann wrote:

>Hello,
>
>I downloaded your code, but it basically broke the part of my code that
>registers regulars notification entries. I had a look at the source 
>code, it seems that you changed the index definition for notification 
>entries.
>
>The new definition is:
>
>private static MOTableSubIndex[] snmpNotifyEntryIndexes =
>    new MOTableSubIndex[] {
>        new MOTableSubIndex(SMIConstants.SYNTAX_OCTET_STRING, 1, 32),
>        new MOTableSubIndex(SMIConstants.SYNTAX_OBJECT_IDENTIFIER, 0,
>128)
>  };
>
>This is really wierd for me. As far as I know, notification entries are
>indexed by name and nothing else.
>
>If you look up RFC 2573
>
>The definition is
>
>----
>   snmpNotifyEntry OBJECT-TYPE
>       SYNTAX      SnmpNotifyEntry
>       MAX-ACCESS  not-accessible
>       STATUS      current
>       DESCRIPTION "blah-blah"
>       INDEX { IMPLIED snmpNotifyName }
>       ::= { snmpNotifyTable 1 }
>----
>
>Best regards
>
>Matthias Wiesmann
>
>
>On 02/02/06, Frank Fock <fock at agentpp.com> wrote:
>  
>
>>Hello Matthias,
>>
>>There are several bugs in this area in the current alpha release. I
>>have uploaded the current version of SnmpNotificationMib.java to 
>>http://www.snmp4j.org/SnmpNotificationMib.java
>>
>>Best regards,
>>Frank
>>
>>
>>Matthias Wiesmann wrote:
>>
>>    
>>
>>>Hello everybody
>>>
>>>I have a situation that I don't understand with notification filters.
>>>I have installed a notification filter, but the notification 
>>>mechanism seems not to see it.
>>>
>>>Here is the state of my filtertable
>>>
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterProfileName.'hb-kt-dhcp22.jais
>>>t.ac.jp'
>>>= STRING: hb-kt-dhcp22.jaist.ac.jp 
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterProfileStorType.'hb-kt-dhcp22.
>>>jaist.ac.jp'
>>>= INTEGER: nonVolatile(3)
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterProfileRowStatus.'hb-kt-dhcp22
.jaist.ac.jp'
>>>= INTEGER: active(1)
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterMask."hb-kt-dhcp22.jaist.ac.jp
".1.3.6.1.4.1.999.1.2.1.104.98.45.107.116.45.100.104.99.112.50.50.46.106
.97.105.115.116.46.97.99.46.106.112
>>>= ""
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterType."hb-kt-dhcp22.jaist.ac.jp
".1.3.6.1.4.1.999.1.2.1.104.98.45.107.116.45.100.104.99.112.50.50.46.106
.97.105.115.116.46.97.99.46.106.112
>>>= INTEGER: included(1)
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterStorageType."hb-kt-dhcp22.jais
t.ac.jp".1.3.6.1.4.1.999.1.2.1.104.98.45.107.116.45.100.104.99.112.50.50
.46.106.97.105.115.116.46.97.99.46.106.112
>>>= INTEGER: nonVolatile(3)
>>>SNMP-NOTIFICATION-MIB::snmpNotifyFilterRowStatus."hb-kt-dhcp22.jaist.
ac.jp".1.3.6.1.4.1.999.1.2.1.104.98.45.107.116.45.100.104.99.112.50.50.4
6.106.97.105.115.116.46.97.99.46.106.112
>>>= INTEGER: active(1)
>>>
>>>I have modified the SnmpNotificationMIB:passesFilter to give me some
>>>output information.
>>>
>>>public boolean passesFilter(OID paramsIndex, OID notificationID,
>>>                             VariableBinding[] vbs) {
>>>   MOTableRowFilter activeFilter =
>>>       new
RowStatus.ActiveRowsFilter(idxSnmpNotifyFilterProfileRowStatus);
>>>   List profiles =
>>>       snmpNotifyFilterProfileEntryModel.getRows(paramsIndex,
paramsIndex,
>>>                                                 activeFilter);
>>>   if (profiles.size() == 0) {
>>>      final OctetString params = new
>>>OctetString(MOTableIndex.getBytes(paramsIndex)) ;
>>>      logger.info("found not matching profile for "+params+" /
"+notificationID) ;
>>>     // no profile -> passes filter
>>>
>>>     return true;
>>>   }
>>>
>>>But when i run my code, I get this output
>>>
>>>found not matching profile for hb-kt-dhcp22.jaist.ac.jp /
>>>1.3.6.1.4.1.999.1.2.1.104.98.45.107.116.45.100.104.99.112.50.50.46.10
>>>6.97.105.115.116.46.97.99.46.106.112
>>>
>>>I don't understand why the notification mechanism cannot see my
>>>profile.
>>>
>>>Does anybody have any idea?
>>>
>>>Cheers
>>>
>>>Matthias Wiesmann _______________________________________________
>>>SNMP4J mailing list
>>>SNMP4J at agentpp.org http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>
>>>
>>>
>>>
>>>      
>>>
>>--
>>AGENT++
>>http://www.agentpp.com
>>http://www.mibexplorer.com
>>http://www.mibdesigner.com
>>
>>
>>
>>    
>>
>
>
>  
>


-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com


_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list