Net::SNMP::QueryEngine::AnyEvent - multiplexing SNMP query engine client using AnyEvent
Version 0.06
This is an AnyEvent-flavored Perl client for snmp-query-engine, a multiplexing SNMP query engine.
use Net::SNMP::QueryEngine::AnyEvent; my $sqe = Net::SNMP::QueryEngine::AnyEvent->new; $sqe->setopt("127.0.0.1", 161, { community => "meow" }, sub {}); $sqe->when_done("127.0.0.1", 161, sub { print "done with localhost\n" }); $sqe->gettable("127.0.0.1", 161, "1.3.6.1.2.1.1", sub { my ($h, $ok, $r) = @_; for my $t (@$r) { print "$t->[0] => $t->[1]\n"; } }); $sqe->get("127.0.0.1", 161, ["1.3.6.1.2.1.1.5.0", "1.3.6.1.2.1.25.1.1.0"], sub { my ($h, $ok, $r) = @_; print "Hostname: $r->[0][1]\n"; print "Uptime : $r->[1][1]\n"; }); $sqe->wait;
Constructor. Takes the same arguments as the constructor of the base class, AnyEvent::Handle::new, but always overrides "on_read" callback.
By default, connects to snmp-query-engine listening on localhost, port 7667. Override this by specifying a "connect" argument.
Execute provided callback when there are no unfinished get or gettable queries towards a specified host:port.
Enters event loop until there are no unanswered queries. Can be called multiple times.
Performs setopt request.
Performs getopt request.
Performs get request for arbitrary number of OIDs.
Performs gettable request.
Performs info request.
Performs dest_info request.
Anton Berezin, <tobez at tobez.org>
<tobez at tobez.org>
Please report any bugs or feature requests to bug-net-snmp-queryengine-anyevent at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-SNMP-QueryEngine-AnyEvent. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-snmp-queryengine-anyevent at rt.cpan.org
The snmp-query-engine daemon can be found on github at https://github.com/tobez/snmp-query-engine.
You can find documentation for this module with the perldoc command.
perldoc Net::SNMP::QueryEngine::AnyEvent
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-SNMP-QueryEngine-AnyEvent
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-SNMP-QueryEngine-AnyEvent
CPAN Ratings
http://cpanratings.perl.org/d/Net-SNMP-QueryEngine-AnyEvent
Search CPAN
http://search.cpan.org/dist/Net-SNMP-QueryEngine-AnyEvent/
This work is in part sponsored by Telia Denmark.
Copyright (c) 2012-2015, Anton Berezin "<tobez@tobez.org>". All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install Net::SNMP::QueryEngine::AnyEvent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SNMP::QueryEngine::AnyEvent
CPAN shell
perl -MCPAN -e shell install Net::SNMP::QueryEngine::AnyEvent
For more information on module installation, please visit the detailed CPAN module installation guide.