The fixed time basis is variable (set with a switch). It defaults to 1 minute for checking modems and 5 minutes for refreshing the IP cache.

It sounds like running the snmp queries sequentially is the way to go. If I am passing a hash reference to the forked subs, wouldn't that allow all of them to access the data in 'real time'?

IE the snmp polling child is halfway through, so half the values are updated and half are stale, but the analysis/plotting child would still access that hash without waiting for the first child to finish. Would perl complain that the resource was being used by to processes?

Secondly, I'm starting to convert code over (I have all of the polling stuff written for another project, but I guess I'm not understading how to pass/use references in a sub.

I have this sub:

sub loadIPs { my $datahashref = shift; my $parmhashref = shift; my $IPs = '1.3.6.1.2.1.10.127.1.3.3.1.3'; my ($session, $error) = Net::SNMP->session($parmhashref); my $reply = $session->get_table(-baseoid=> $IPs); my %reply = %$reply; while ( my ($oid, $ip) = each(%reply) ) { my %tmpHash = (rx=>NULL, tx=>NULL); %$datahashref{$ip} = %tmpHash unless exists $datahashref{$ip}; } }


Basically the master hash is a hash of hashes. This sub gets a list of IPs and updates the master list with a blank entry.

However, it doesn't like how I'm referencing %$datahashref

In reply to Re^2: initial walkthrough by vortmax
in thread initial walkthrough by vortmax

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.