Hi Rushik, You can use two (or more) separate USM instances. However, you need to be careful with that. The following FAQ article describes the details: http://oosnmp.net/confluence/pages/viewpage.action?pageId=1441800
For your proxy setup, you can easily use the http://www.snmp4j.org/agent/doc/org/snmp4j/agent/mo/snmp4j/MOSubtreeProxy.html of SNMP4J-Agent. Best regards, Frank > On 27 Feb 2016, at 20:59, <[email protected]> <[email protected]> wrote: > > Figured out issue with security model overriding my usm. > Since security model is a singleton instance. > Is there a way to use different security model for multiple SNMP sessions? > I tried to set a new one by creating a new message processor and setting it > in there. > > Sent from my iPhone > >> On Feb 26, 2016, at 5:33 PM, [email protected] wrote: >> >> Hello, >> I am working on a project using snmp4j where my application needs to be a >> dual agent/manager. >> Think of this as a relay, a middle man snmp application. >> it will do the following: >> 1)it will listen for requests from a beginning SNMP client (mib browser for >> example). >> 2) read those requests from beginning SNMP client, do some OID translation >> to my own custom MIB >> 3) send the request with the OID translation to the end Client >> 4) get the response from the end Client, do some backwards OID translation >> 5) send the response PDU back to the beginning SNMP Client for the request >> from step 1 >> >> >> The way I developed this was for the agent end, I extended "BaseAgent" class >> in snmp4j agent for my agent to listen for requests from my beginning SNMP >> client. >> I am overriding the processPdu method in "CommandProcessor" to intercept the >> requests in the "CommnadResponderEvent", do my OID translation. >> For the manager end, then call a snmp Manager session within the "Command >> Processor" (using the "snmp" Class from snmp4j )to send the requests (get, >> getnext, getbulk) to my end Client >> read the response back in "ResponseEvent" instance from the end Client. >> parse the response and do my backwards OID translation and set the var >> bindings in the response PDU to be sent back to the Beginning Client using >> "returnResponsePDU" from the "commandResponderEvent" >> >> >> my implementation is working for v1 and v2, but for v3 I am getting an issue >> with the response back to the Beginning Client in step 5 above. the message >> Authoritative engineID and engineBoots are set to 0 which is causing the >> response to be discarded by the Beginning Client. >> I did some debugging and i know the engineID and engineBoots are set from >> the USM Time table based on the security state reference. >> >> I am thinking my implementation is causing some conflict with the USM since >> my snmpManager is initialized and used within the Command Processor for the >> snmpAgent end. >> if i comment out my snmpManager, the response is sent back correctly with >> the engineID and engineBoots populated correctly from the USM. >> would it beneficial to maybe use the Proxy Forward feature in snmp4j instead >> of this approach? I was thinking if using the Proxy Forward but i have to >> do some oid Translation so i needed to intercept the PDU so that is why i >> overloaded the processPDU function in the CommandProcessor class. >> any help or insight would be appreciated. >> >> thanks >> Rushik >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> SNMP4J mailing list >> [email protected] >> https://oosnmp.net/mailman/listinfo/snmp4j > _______________________________________________ > SNMP4J mailing list > [email protected] > https://oosnmp.net/mailman/listinfo/snmp4j _______________________________________________ SNMP4J mailing list [email protected] https://oosnmp.net/mailman/listinfo/snmp4j
