in reply to Re^2: threads and SNMP Session
in thread threads and SNMP Session

If you are issuing identical requests to multiple hosts, you can just use SNMP::Multi and forget about the details :)

If not, take a look at the source for SNMP::Multi, in particular the request() & execute() subs, to see what needs to be done. Basically, loop over the hosts issuing your get()s and passing a callback, (closures would be good here), and then enter the MainLoop and allow it to go to work.

Of course, there's a bit more to it that that with timeouts, retries and collating the information returned.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.