I started ur script. I'm not sure what it'll show but it's running
and I'm monitoring it. :) I added a printlock and made the
processResults() just print a status message. There is one
problem with ur code, the second SNMP call will never be made.
Nonblocking calls always return true. That would be a big problem
in production code since we don't know which one we need ahead
of time. I would have to spin the dispatcher, see if the oids
were defined, and then spin it again possibly. The other major
problem with the spin dispatcher method is that I don't know
what IP's to poll ahead of time. That's one of the reasons I
did it as stand alone threads with blocking SNMP. I wouldn't be
able to queue up tons of SNMP calls and then spin the dispatcher
and wait for the data. I'ld have to queue up small bits of calls
and spin the thing over and over again. So it doesn't really
buy me anything. :)
Ok the script completed. It only used about 300 MB of memory.
As I expected the non CIDR devices returned nothing. :) I'ld be
interested to see how the nonblocking calls behave within worker
threads.. Hmm.
Another thing I tried. In my leaker3 I moved the require Net::SNMP
down into the entrypoint as eval "require Net::SNMP"; figuring
that way there would be *no* objects to clone since the entire
module wasn't instantiated yet. Doing that used up even more
memory than require'ing it at the top of the script. :P
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.