PySNMP Thread unsafe?

R

rob.audenaerde

I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too much.


Here comes my problem. When using PySNMP single threaded, every this
goes well; but if I create 10 threads, it all goes awry... It seems
PySNMP is not thread safe? Can anyone elaborate on this?
 
C

Chris Lambacher

I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too much.


Here comes my problem. When using PySNMP single threaded, every this
goes well; but if I create 10 threads, it all goes awry... It seems
PySNMP is not thread safe? Can anyone elaborate on this?
What does 'goes awry' mean? Your statement is too vague to be able to help
you figure out your problem.
 
E

etingof

pysnmp has been designed to be MT-safe. Although, I've never used it in
a MT app, so there may be a bug showing up when you do threading...

At its simplest, I'd advise snooping on the wire to make sure you are
querying different devices at the same time and also to see where the
[I assume] bottleneck really is -- is it in a sending or receiving
phase of the query.

If you could show me the code that causes the trouble?

(e-mail address removed) пиÑал(а):
 
N

Nick Craig-Wood

I'm trying to monitor about 250 devices with SNMP, using PySNMP version
4. I use the threading.Thread to create a threadpool of 10 threads, so
devices not responding won't slow down the monitoring process too
much.

This is surely a job for twisted not threads? You'd be able to poll
all 250 devices at once with twisted...

This might be helpful (haven't tried it myself though)

http://twistedsnmp.sourceforge.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top