Otogi has asked for the wisdom of the Perl Monks concerning the following question:

I want to use multithreading to poll(snmpwalk) a number of devices, I have read that netsnmp package is not multithreading safe. I need a package that will give me a thread safe module to do this. I would also appreciate multithreaded code examples that do the requested efficiently. Thank you in advance.

Replies are listed 'Best First'.
Re: snmp threads
by tirwhan (Abbot) on Dec 13, 2005 at 22:31 UTC

    You could always use fork and run several processes instead of threads (if you're on a *NIX that is, I hear that on Windows this is less of an option).


    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
Re: snmp threads
by turo (Friar) on Dec 13, 2005 at 22:36 UTC
    I think you can launch some threads and use within them a local instance of Net::SNMP object for making the GET and getNext request, without any problems.

    good luck

    perl -Te 'print map { chr((ord)-((10,20,2,7)$i++)) } split //,"turo"'
      I'm using net-snmp how do i created a local instance of the session? It seems that all sessions are stopped in all threads except the last created thread. Thank you!