diff --git a/ChangeLog b/ChangeLog index 208c20ec..72681ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,12 @@ SNMP::Info - Perl5 OO Interface to Network Devices and SNMP MIBs ChangeLog $Id$ -version 0.5 () +version 0.5 (06/10/03) * Added ability to get paritial tables. For example to get the IP routing table for 128.114.* you can do $ipr = $dev->ipr_dest('128.114'); * Added IP Routing Table entries from RFC1213 to SNMP::Info + * minor bug fixes version 0.4 (04/29/03) * BIG CHANGE ! Internal Data structure has changed. diff --git a/Info.pm b/Info.pm index 81fb3ed1..cbc5a54f 100644 --- a/Info.pm +++ b/Info.pm @@ -7,7 +7,7 @@ # See COPYRIGHT at bottom package SNMP::Info; -$VERSION = 0.4; +$VERSION = 0.5; use strict; use Exporter; @@ -27,7 +27,7 @@ SNMP::Info - Object Oriented Perl5 Interface to Network devices and MIBs through =head1 VERSION -SNMP::Info - Version 0.4 +SNMP::Info - Version 0.5 =head1 AUTHOR @@ -804,6 +804,7 @@ correspond with the number of physical ports Each of these methods returns a hash_reference to a hash keyed on the interface index in SNMP. Example : $info->interfaces() might return + { '1.12' => 'FastEthernet/0', '2.15' => 'FastEthernet/1', '9.99' => 'FastEthernet/2' @@ -812,6 +813,20 @@ Example : $info->interfaces() might return The key is what you would see if you were to do an snmpwalk, and in some cases changes between reboots of the network device. +=head2 Partial Table Fetches + +If you want to get only a part of an SNMP table and you know the IID for the part of the table that you +want, you can specify it in the call: + + $local_routes = $info->ipr_route('192.168.0'); + +This will only fetch entries in the table that start with C<192.168.0>, which in this case are routes on the local +network. + +Remember that you must supply the partial IID (a numeric OID). + +Partial table results are not cached. + =head3 Interface Information =over diff --git a/Info/Bridge.pm b/Info/Bridge.pm index 8f6594b5..8e8d4bf6 100644 --- a/Info/Bridge.pm +++ b/Info/Bridge.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Bridge; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/CDP.pm b/Info/CDP.pm index d252405c..c467f0de 100644 --- a/Info/CDP.pm +++ b/Info/CDP.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CDP; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/CiscoStats.pm b/Info/CiscoStats.pm index 5a8709e2..a156128f 100644 --- a/Info/CiscoStats.pm +++ b/Info/CiscoStats.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CiscoStats; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Entity.pm b/Info/Entity.pm index f9807cdd..969533e5 100644 --- a/Info/Entity.pm +++ b/Info/Entity.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Entity; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/EtherLike.pm b/Info/EtherLike.pm index aae282c5..d7d3a761 100644 --- a/Info/EtherLike.pm +++ b/Info/EtherLike.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::EtherLike; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer1.pm b/Info/Layer1.pm index 4fdde966..788150ce 100644 --- a/Info/Layer1.pm +++ b/Info/Layer1.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer1; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer1/Allied.pm b/Info/Layer1/Allied.pm index dd17a86c..3c7a8567 100644 --- a/Info/Layer1/Allied.pm +++ b/Info/Layer1/Allied.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer1::Allied; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer1/Asante.pm b/Info/Layer1/Asante.pm index 879a8d0d..22bcaef0 100644 --- a/Info/Layer1/Asante.pm +++ b/Info/Layer1/Asante.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer1::Asante; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2.pm b/Info/Layer2.pm index 78795415..9262008d 100644 --- a/Info/Layer2.pm +++ b/Info/Layer2.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/Aironet.pm b/Info/Layer2/Aironet.pm index 05a19be7..7955fc0f 100644 --- a/Info/Layer2/Aironet.pm +++ b/Info/Layer2/Aironet.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::Aironet; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/Bay.pm b/Info/Layer2/Bay.pm index 6ba45412..8469cb52 100644 --- a/Info/Layer2/Bay.pm +++ b/Info/Layer2/Bay.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::Bay; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/C1900.pm b/Info/Layer2/C1900.pm index 3a135bf8..5769d8f6 100644 --- a/Info/Layer2/C1900.pm +++ b/Info/Layer2/C1900.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::C1900; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/C2900.pm b/Info/Layer2/C2900.pm index ca43f00f..60f310cd 100644 --- a/Info/Layer2/C2900.pm +++ b/Info/Layer2/C2900.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::C2900; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/Catalyst.pm b/Info/Layer2/Catalyst.pm index adb382c5..bdc54d91 100644 --- a/Info/Layer2/Catalyst.pm +++ b/Info/Layer2/Catalyst.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::Catalyst; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer2/HP.pm b/Info/Layer2/HP.pm index e3482b58..e28431fd 100644 --- a/Info/Layer2/HP.pm +++ b/Info/Layer2/HP.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2::HP; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer3.pm b/Info/Layer3.pm index b24d9484..1a473b58 100644 --- a/Info/Layer3.pm +++ b/Info/Layer3.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer3/Aironet.pm b/Info/Layer3/Aironet.pm index e3912133..5392c449 100644 --- a/Info/Layer3/Aironet.pm +++ b/Info/Layer3/Aironet.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3::Aironet; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer3/C3550.pm b/Info/Layer3/C3550.pm index 83ebb0cc..0f21d37b 100644 --- a/Info/Layer3/C3550.pm +++ b/Info/Layer3/C3550.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3::C3550; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/Layer3/Foundry.pm b/Info/Layer3/Foundry.pm index 31b52243..bd5ba174 100644 --- a/Info/Layer3/Foundry.pm +++ b/Info/Layer3/Foundry.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3::Foundry; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/Info/MAU.pm b/Info/MAU.pm index c7cb4d89..cfa9e0a0 100644 --- a/Info/MAU.pm +++ b/Info/MAU.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::MAU; -$VERSION = 0.4; +$VERSION = 0.5; # $Id$ use strict; diff --git a/README b/README index f27c0561..b1c0065d 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ NAME VERSION - SNMP::Info - Version 0.4 + SNMP::Info - Version 0.5 AUTHOR @@ -64,6 +64,12 @@ SYNOPSIS } +SUPPORT + + Please direct all support, help, and bug requests to the snmp-info-users + Mailing List at + http://lists.sourceforge.net/lists/listinfo/snmp-info-users + DESCRIPTION SNMP::Info gives an object oriented interface to information obtained @@ -477,12 +483,30 @@ USAGE Each of these methods returns a hash_reference to a hash keyed on the interface index in SNMP. - Example : $info->interfaces() might return { '1.12' => 'FastEthernet/0', - '2.15' => 'FastEthernet/1', '9.99' => 'FastEthernet/2' } + Example : $info->interfaces() might return + + { '1.12' => 'FastEthernet/0', + '2.15' => 'FastEthernet/1', + '9.99' => 'FastEthernet/2' + } The key is what you would see if you were to do an snmpwalk, and in some cases changes between reboots of the network device. + Partial Table Fetches + + If you want to get only a part of an SNMP table and you know the IID for + the part of the table that you want, you can specify it in the call: + + $local_routes = $info->ipr_route('192.168.0'); + + This will only fetch entries in the table that start with "192.168.0", + which in this case are routes on the local network. + + Remember that you must supply the partial IID (a numeric OID). + + Partial table results are not cached. + Interface Information $info->interfaces() @@ -638,6 +662,122 @@ USAGE (ipAdEntBcastAddr) + IP Routing Table + + $info->ipr_route() + The route in question. A value of 0.0.0.0 is the default gateway + route. + + ("ipRouteDest") + + $info->ipr_if() + The interface (IID) that the route is on. Use interfaces() to map. + + ("ipRouteIfIndex") + + $info->ipr_1() + Primary routing metric for this route. + + ("ipRouteMetric1") + + $info->ipr_2() + If metrics are not used, they should be set to -1 + + ("ipRouteMetric2") + + $info->ipr_3() + ("ipRouteMetric3") + + $info->ipr_4() + ("ipRouteMetric4") + + $info->ipr_5() + ("ipRouteMetric5") + + $info->ipr_dest() + From RFC1213: + + "The IP address of the next hop of this route. + (In the case of a route bound to an interface + which is realized via a broadcast media, the value + of this field is the agent's IP address on that + interface.)" + + ("ipRouteNextHop") + + $info->ipr_type() + From RFC1213: + + other(1), -- none of the following + invalid(2), -- an invalidated route + -- route to directly + direct(3), -- connected (sub-)network + -- route to a non-local + indirect(4) -- host/network/sub-network + + "The type of route. Note that the values + direct(3) and indirect(4) refer to the notion of + direct and indirect routing in the IP + architecture. + + Setting this object to the value invalid(2) has + the effect of invalidating the corresponding entry + in the ipRouteTable object. That is, it + effectively disassociates the destination + identified with said entry from the route + identified with said entry. It is an + implementation-specific matter as to whether the + agent removes an invalidated entry from the table. + Accordingly, management stations must be prepared + to receive tabular information from agents that + corresponds to entries not currently in use. + Proper interpretation of such entries requires + examination of the relevant ipRouteType object." + + ("ipRouteType") + + $info->ipr_proto() + From RFC1213: + + other(1), -- none of the following + -- non-protocol information, + -- e.g., manually configured + local(2), -- entries + -- set via a network + netmgmt(3), -- management protocol + -- obtained via ICMP, + icmp(4), -- e.g., Redirect + -- the remaining values are + -- all gateway routing + -- protocols + egp(5), + ggp(6), + hello(7), + rip(8), + is-is(9), + es-is(10), + ciscoIgrp(11), + bbnSpfIgp(12), + ospf(13), + bgp(14) + + ("ipRouteProto") + + $info->ipr_age() + Seconds since route was last updated or validated. + + ("ipRouteAge") + + $info->ipr_mask() + Subnet Mask of route. 0.0.0.0 for default gateway. + + ("ipRouteMask") + + $info->ipr_info() + Reference to MIB definition specific to routing protocol. + + ("ipRouteInfo") + Setting data via SNMP This section explains how to use SNMP::Info to do SNMP Set operations.