By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,548 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,548 IT Pros & Developers. It's quick & easy.

PySNMP Thread unsafe?

P: n/a
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?

Jul 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mon, Jul 24, 2006 at 02:21:10AM -0700, ro************@gmail.com wrote:
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.
>
--
http://mail.python.org/mailman/listinfo/python-list
Jul 24 '06 #2

P: n/a
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?

ro************@gmail.com писал(а):
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?
Jul 25 '06 #3

P: n/a
ro************@gmail.com <ro************@gmail.comwrote:
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/

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jul 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.