[SNMP4J] Need help with Snmp4j CommandResponder

Frank Fock fock at agentpp.com
Tue Jun 20 17:59:11 CEST 2006


Hi Srinivas,

OK, what does this proof? The trace indicates that
the message is *sent* from 192.168.4.159/888 how
can your SNMP4J based program then listen on that
address?

Best regards,
Frank

Y Srinivas wrote:
> Hi Frank,
> 
> Thank you for your quick response.
> 
> I used snmp.listen() but no go it just waits for responses.
> 
> here is the snmp trace from a utility.
> 
> 
> Received 47 bytes from 192.168.4.159 : 888
> 
> SNMP Version 1
> SNMP community = "public"
> Response
> Request ID = 1234
> ErrorStatus = 0 ErrorIndex = 0
> 
> Variable bindings contain 1 variable(s)
> OID=1.3.6.1.4.1.2591.15.1.1.6.0 Type=OctetString Len=2
> HexVal=4F4B charval=OK
> ____________________________________________________________
> 
> Received 47 bytes from 192.168.4.159 : 888
> 
> SNMP Version 1
> SNMP community = "public"
> Response
> Request ID = 1234
> ErrorStatus = 0 ErrorIndex = 0
> 
> Variable bindings contain 1 variable(s)
> OID=1.3.6.1.4.1.2591.15.1.1.6.0 Type=OctetString Len=2
> HexVal=4F4B charval=OK
> ____________________________________________________________
> 
> Received 47 bytes from 192.168.4.159 : 888
> 
> SNMP Version 1
> SNMP community = "public"
> Response
> Request ID = 1234
> ErrorStatus = 0 ErrorIndex = 0
> 
> Variable bindings contain 1 variable(s)
> OID=1.3.6.1.4.1.2591.15.1.1.6.0 Type=OctetString Len=2
> HexVal=4F4B charval=OK
> 
> 
> regards,
> Srinivas
> ----- Original Message -----
> From: "Frank Fock" <fock at agentpp.com>
> To: "Y Srinivas" <ysrinivas at indusnetworks.com>
> Cc: <snmp4j at agentpp.org>
> Sent: Tuesday, 20 June, 2006 11:19 AM
> Subject: Re: [SNMP4J] Need help with Snmp4j CommandResponder
> 
> 
>> Hi Srinivas,
>>
>> You need to call "snmp.listen()" instead of
>> "transport.listen()". That's all.
>>
>> Best regards,
>> Frank
>>
>> Y Srinivas wrote:
>>> Hi Frank,
>>>
>>> I have problem listening to responses and to read responses i
>>> have used the following lines of code but i don't see that
> the
>>> program is catching any responses as i am able to do with a
> snmp
>>> tracer.
>>>
>>> class MySnmp1 implements CommandResponder{
>>>  TransportMapping transport;
>>>  Snmp snmp;
>>>  public MySnmp1(){
>>>   try{
>>>   transport = new DefaultUdpTransportMapping(new
>>> UdpAddress("192.168.4.58/888"));
>>>   snmp = new Snmp(transport);
>>>   snmp.addCommandResponder(this);
>>>   System.out.println("transportBinding..");
>>>   transport.listen();
>>>   }catch(Exception e){e.printStackTrace();}
>>>  }
>>>  public synchronized void processPdu(CommandResponderEvent e)
> {
>>>      System.out.println("----Received Response -----");
>>>     }
>>>  public static void main(String[] args) throws Exception
>>>  {
>>>   new MySnmp1();
>>>   while(true){}
>>>  }
>>> }
>>>
>>> regards,
>>> Srinivas
>>>
>>> _______________________________________________
>>> 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




More information about the SNMP4J mailing list