Hello everyone,

I am having some trouble with perl threads and snmp. What i am trying to do is to create a pool of threads in that each thread in the pool is making the same snmpget on a different host. Each thread establishes its own SNMP session naturally and has its own SNMP variables. The threads on the pool are waiting for ip addresses to work with. The thing is when the first ip address is available and the first thread starts to work it can't do the snmpget and it says "thread failed to start" because of it. I have made print on every variable possible and still don't get it, why can't each thread do an snmp get individually. Notice that as i have said each thread is creating it's own session and hence doing it's own snmpget.

To invoke the threads i do "use threads;" and to invoke snmp libraries i do "use SNMP;"

help ?

Cheers

In reply to Problem using threads and snmp by rnery

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.