SNMP::Query::Asynch

Fast asynchronous execution of batches of SNMP queries
Download

SNMP::Query::Asynch Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Stephen R. Scaffidi
  • Publisher web site:
  • http://search.cpan.org/~sscaffidi/

SNMP::Query::Asynch Tags


SNMP::Query::Asynch Description

Fast asynchronous execution of batches of SNMP queries SNMP::Query::Asynch is a Perl module that allows for a fairly simple, streamlined means of executing large numbers of SNMP operations as fast as your systems can handle. It extensively uses net-snmp's asynchronous operation interfaces and callbacks to keep as much data flowing as you need.Perl's support of closures and anonymous subroutines provide the means for sophisticated, elegant control of query operations before and after execution. There are also facilities to install callbacks that are run after pre-set numbers (batches) of operations are completed .These callbacks can be used to log progress, update the user, transfer results from memory to disk (or even another thread or process!) or anything you can think of! If there's some feature you desire, do not hesitate to ask me!!!Please be aware - my primary design concern is speed and flexibility. I have certain non-scientific, subjective benchmarks I use to decide if some modification is worth-while, but so far the design of the internals of this module has lent itself to feature additions and enhancements very well.SYNOPSIS use SNMP::Query::Asynch; my @varbinds = qw( ifDescr ifInOctets ifOutOctets ifAlias ifType ifName ifInErrors ifOutErrors ifSpeed ifAdminStatus ifOperStatus ); my $query = SNMP::Query::Asynch->new(); # You should create and populate @hosts to make this synposis code work. # It's an AoH, fairly simple. For example... my @hosts = create_hosts_array('snmp_hosts.csv'); foreach my $host (@hosts) { # Add a getbulk operation to the queue. $query->add_getbulk({ # Params passed to directly to SNMP::Session->new() DestHost => $host->{HOSTIP}, Community => $host->{COMMUNITY}, Version => $host->{SNMPVER}, # getbulk only supports 2 or 3. # Params concerning the type of query operation # See POD for SNMP::Session->getbulk() in this case. MaxRepeaters => 20, NonRepeaters => 0, # The varbinds to be operated on - can be a reference to anything # supported by the corresponding query operation in SNMP::Session. VarBinds => \@varbinds, }); } # Execute the queries that were added, get a reference to the results array. my $results = $query->execute({ InFlight => 50, # Simultaneous operations MasterTimeout => 60, # Seconds until unfinished operations are aborted. }); # See what the results look like. use Data::Dumper; print Dumper $results; Requirements: · Perl


SNMP::Query::Asynch Related Software