[SNMP4J] How to get the community of a ResponseEvent

兼俵 麻実 asamik at fsi.co.jp
Thu Mar 22 12:48:00 CET 2007


Hi Everyone,

I have something ask to you about to get the community.

When the community of actual Agent is "private",
if I wrote 「CommunityTarget.setCommunity(new OctetString("public"));」 in
my application,
the system could receive Response.

I know it isn't normal operation.
But, my application needs implementation in this case.

Would you tell me how to get the community of incoming snmp v1/v2c messages,
on a ResponseListener?

   ResponseListener listener = new ResponseListener() {
     public void onResponse(ResponseEvent event) {
       ((Snmp)event.getSource()).cancel(event.getRequest(), this);
       System.out.println("Received response PDU is: "+event.getResponse());

       //!!!!!! I'd like to get the community , here. !!!!!

     }
   };
   snmp.send(pdu, target, null, listener);


or if you have any idea for not receiveing when the community is different,
please let me know.


thanks,
karia 




More information about the SNMP4J mailing list