Net::SNMP::Mixin::IpRouteTable - mixin class for the mib-II ipRouteTable
Version 0.03
use Net::SNMP; use Net::SNMP::Mixin; #... my $session = Net::SNMP->session( -hostname => 'foo.bar.com' ); $session->mixer('Net::SNMP::Mixin::IpRouteTable'); $session->init_mixins; snmp_dispatcher(); die $session->errors if $session->errors; my @routes = get_ip_route_table(); foreach my $route ( @routes ) { my $dest = $route->{ipRouteDest}; my $mask = $route->{ipRouteMask}; my $nhop = $route->{ipRouteNextHop}; my $proto_str = $route->{ipRouteProtoString}; my $type_str = $route->{ipRouteTypeString}; print "$dest/$mask => $nhop $proto_str $type_str\n"; }
A Net::SNMP mixin class for mib-II ipRouteTable info.
Returns the mib-II ipRouteTable as a list. Every route entry is a reference to a hash with the following fields and values:
{ ipRouteDest => IpAddress, ipRouteMask => IpAddress, ipRouteNextHop => IpAddress, ipRouteIfIndex => INTEGER, ipRouteMetric1 => INTEGER, ipRouteMetric2 => INTEGER, ipRouteMetric3 => INTEGER, ipRouteMetric4 => INTEGER, ipRouteMetric5 => INTEGER, ipRouteType => INTEGER, ipRouteTypeString => String, # resolved enum ipRouteProto => INTEGER, ipRouteTypeProto => String, # resolved enum ipRouteAge => INTEGER, ipRouteInfo => OBJECT IDENTIFIER }
Fetch the mib-II ipRouteTable from the host. Don't call this method direct!
Only for developers or maintainers.
Fetch the ipRouteTable once during object initialization.
The callback for _fetch_ip_route_tbl().
Net::SNMP::Mixin
Net::SNMP, Net::SNMP::Mixin
There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.
Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to gaissmai@cpan.org .
RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP-Mixin-IpRouteTable
Karl Gaissmaier <karl.gaissmaier at uni-ulm.de>
Copyright 2008-2011 Karl Gaissmaier, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::SNMP::Mixin::IpRouteTable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SNMP::Mixin::IpRouteTable
CPAN shell
perl -MCPAN -e shell install Net::SNMP::Mixin::IpRouteTable
For more information on module installation, please visit the detailed CPAN module installation guide.