Re: [pysnmp-dev] Regarding use of Dispatcher with Multiprocessing
Brought to you by:
elie
From: Ani A <ani...@gm...> - 2015-02-27 05:01:38
|
Hi Ilya, I am trying to create something like a _proxy_, the goal is to be able to intercept traps from the local SNMP Agent, and then peeking into the varbinds, decide which one of the remote trap-receivers to send to. Traps are the first goal, then, for Informs, I need to be able to get the ack, and send it back to the main agent as well. Since I am using Multiprocessing module [1], do I still have to worry about MT safe? (the networking part of this, is that the receivers are all on different networks [ different Linux namespaces ], so I have to get the SNMP payload and then build a separate UDP packet and send, unless there is an easier way/API that I can use to just change the IP and send) Hope I explained the problem [that I am trying to solve], clearly. Any help/tips/guidance very much welcome. [1] https://docs.python.org/2/library/multiprocessing.html -- Ani On Fri, Feb 27, 2015 at 1:09 AM, Ilya Etingof <il...@gl...> wrote: > Hi Ani, > > At what point you are going to employ threading? Just for SNMP receiving > part (what is not easy since a single instance of SNMP engine is not > MT-safe) or for some sort of custom processing logic beyond SNMP engine? > > -ilya > > > On 24 Feb 2015, at 09:44, Ani A <ani...@gm...> wrote: > > > > Hello, > > > > I was running through the examples in pysnmp (for Trap receiver with V3 > case) > > and I have a few doubts (maybe trivial! but somehow I am not getting it) > > > > I want to use pysnmp, with Python's Multiprocessing module, so in > > each Process's callback function, do I run the following ? > > > > try: > > snmpEngine.transportDispatcher.runDispatcher() > > except: > > snmpEngine.transportDispatcher.closeDispatcher() > > raise > > > > i.e, what should my main-loop wait on? , since I have another Queue as > well > > which I need to check. > > > > Thanks. > > — > > Ani > > |