[SNMP4J] catch GETBULK for dynamic table
Alexander Fooks
afooks at allot.com
Thu Oct 2 10:12:50 CEST 2008
Hi, Frank,
Thanks for your answer.
I did exactly as in Snmp4jLogMib.java and I want to fill the table each
time when received GETBULK request:
Object updateSource = null;
public void lookupEvent(MOServerLookupEvent event) {
if (event.getLookupResult() == this.alCustomEntry &&
(!DefaultMOQuery.isSameSource(event.getQuery(),
updateSource))) {
updateSource = event.getSource();
//
fillTableFromDB();
}
}
But it entered at endless loop on each GETBULK request.
Would you advise how to define "if" for this permanent case if it's
possible.
and where I may wipe the data in table when response has been sent?
Thank you.
Alex Fooks
-----Original Message-----
From: Frank Fock [mailto:fock at agentpp.com]
Sent: Sunday, September 28, 2008 8:38 PM
To: Alexander Fooks
Cc: snmp4j at agentpp.org
Subject: Re: [SNMP4J] catch GETBULK for dynamic table
Hi Alexander,
The get method is not accessed when a GETBULK SNMP request
is being processed. Instead you would have to overwrite
the next(..) method. But this only works, if you have a
stable first and last row in your table which is seldom
the case.
I would recommend using the MOServerLookupEvent described
on page 17 and 18 of the instrumentation how-to instead.
Best regards,
Frank
Alexander Fooks wrote:
> Hi, All,
>
>
>
> I'm new in SNMP4J and looking for answer:
>
>
>
> I use dynamic table defined in my MIB.
>
> In my scenario I need to catch event like GETBULK (getwalk at
snmp-net)
>
> on whole table to fill the table from data base before return the
> response.
>
>
>
> When I use recommended at SNMP4J-Agent-Instrumentation-HowTo.pdf for
> static table it doesn't catch the event.
>
>
>
> public class NXTable extends DefaultMOTable {
>
>
>
> public NXTable(OID oid, MOTableIndex indexDef, MOColumn[]
columns)
> {
>
> super(oid, indexDef, columns);
>
>
>
> }
>
> //
>
> public void get(SubRequest request) {
>
> MOScope affectedOIDScope = request.getScope();
>
> System.out.println("Here!"");
>
> super.get(request);
>
> }
>
> }
>
>
>
>
>
> Could you advise how to do this.
>
>
>
> Thank you in advance
>
>
>
> Alex Fooks
>
>
>
>
>
> _______________________________________________
> 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
More information about the SNMP4J
mailing list