.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Info 3pm" .TH Info 3pm "2016-12-21" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SNMP::Info \- OO Interface to Network devices and MIBs through SNMP .SH "VERSION" .IX Header "VERSION" SNMP::Info \- Version 3.34 .SH "AUTHOR" .IX Header "AUTHOR" SNMP::Info is maintained by team of Open Source authors headed by Eric Miller, Bill Fenner, Max Baker, Jeroen van Ingen and Oliver Gorwits. .PP Please visit for most up-to-date list of developers. .PP SNMP::Info was originally created at \s-1UCSC\s0 for the Netdisco project by Max Baker. .SH "DEVICES SUPPORTED" .IX Header "DEVICES SUPPORTED" There are now generic classes for most types of device and so the authors recommend loading SNMP::Info with AutoSpecify, and then reporting to the mail list any missing functionality (such as neighbor discovery tables). .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use SNMP::Info; \& \& my $info = new SNMP::Info( \& # Auto Discover more specific Device Class \& AutoSpecify => 1, \& Debug => 1, \& # The rest is passed to SNMP::Session \& DestHost => \*(Aqrouter\*(Aq, \& Community => \*(Aqpublic\*(Aq, \& Version => 2 \& ) or die "Can\*(Aqt connect to device.\en"; \& \& my $err = $info\->error(); \& die "SNMP Community or Version probably wrong connecting to device. $err\en" if defined $err; \& \& $name = $info\->name(); \& $class = $info\->class(); \& print "SNMP::Info is using this device class : $class\en"; \& \& # Find out the Duplex status for the ports \& my $interfaces = $info\->interfaces(); \& my $i_duplex = $info\->i_duplex(); \& \& # Get CDP Neighbor info \& my $c_if = $info\->c_if(); \& my $c_ip = $info\->c_ip(); \& my $c_port = $info\->c_port(); \& \& # Print out data per port \& foreach my $iid (keys %$interfaces){ \& my $duplex = $i_duplex\->{$iid}; \& # Print out physical port name, not snmp iid \& my $port = $interfaces\->{$iid}; \& \& print "$port: "; \& print "$duplex duplex" if defined $duplex; \& \& # The CDP Table has table entries different than the interface tables. \& # So we use c_if to get the map from cdp table to interface table. \& \& my %c_map = reverse %$c_if; \& my $c_key = $c_map{$iid}; \& unless (defined $c_key) { \& print "\en\en"; \& next; \& } \& my $neighbor_ip = $c_ip\->{$c_key}; \& my $neighbor_port = $c_port\->{$c_key}; \& \& print " connected to $neighbor_ip / $neighbor_port\en" if defined $neighbor_ip; \& print "\en"; \& \& } .Ve .SH "SUPPORT" .IX Header "SUPPORT" Please direct all support, help, and bug requests to the snmp-info-users Mailing List at . .SH "DESCRIPTION" .IX Header "DESCRIPTION" SNMP::Info gives an object oriented interface to information obtained through \&\s-1SNMP.\s0 .PP This module is geared towards network devices. Subclasses exist for a number of network devices and common MIBs. .PP The idea behind this module is to give a common interface to data from network devices, leaving the device-specific hacks behind the scenes in subclasses. .PP In the \s-1SYNOPSIS\s0 example we fetch the name of all the ports on the device and the duplex setting for that port with two methods \*(-- \fIinterfaces()\fR and \&\fIi_duplex()\fR. .PP The information may be coming from any number of \s-1MIB\s0 files and is very vendor specific. SNMP::Info provides you a common method for all supported devices. .PP Adding support for your own device is easy, and takes little \s-1SNMP\s0 knowledge. .PP The module is not limited to network devices. Any \s-1MIB\s0 or device can be given an objected oriented front-end by making a module that consists of a couple hashes. See \s-1EXTENDING SNMP::INFO.\s0 .SH "REQUIREMENTS" .IX Header "REQUIREMENTS" .IP "1. Net-SNMP" 4 .IX Item "1. Net-SNMP" To use this module, you must have Net-SNMP installed on your system. More specifically you need the Perl modules that come with it. .Sp \&\s-1DO NOT INSTALL SNMP::\s0 or Net::SNMP from \s-1CPAN\s0! .Sp The \s-1SNMP\s0 module is matched to an install of net-snmp, and must be installed from the net-snmp source tree. .Sp The Perl module \f(CW\*(C`SNMP\*(C'\fR is found inside the net-snmp distribution. Go to the \&\fIperl/\fR directory of the distribution to install it, or run \&\f(CW\*(C`./configure \-\-with\-perl\-modules\*(C'\fR from the top directory of the net-snmp distribution. .Sp Net-SNMP can be found at http://net\-snmp.sourceforge.net .Sp Version 5.3.2 or greater is recommended. .Sp Versions 5.0.1, 5.0301 and 5.0203 have issues with bulkwalk and are not supported. .Sp \&\fBRedhat Users\fR: Some versions that come with certain versions of Redhat/Fedora don't have the Perl library installed. Uninstall the \s-1RPM\s0 and install by hand. .IP "2. \s-1MIBS\s0" 4 .IX Item "2. MIBS" SNMP::Info operates on textual descriptors found in MIBs. .Sp If you are using SNMP::Info separate from Netdisco, download the Netdisco \s-1MIB\s0 package at .Sp Make sure that your snmp.conf is updated to point to your \s-1MIB\s0 directory and that the MIBs are world-readable. .SH "DESIGN GOALS" .IX Header "DESIGN GOALS" .IP "1. Use of textual \s-1MIB\s0 leaf identifier and enumerated values" 4 .IX Item "1. Use of textual MIB leaf identifier and enumerated values" .RS 4 .PD 0 .IP "\(bu" 4 .PD All values are retrieved via \s-1MIB\s0 Leaf node names .Sp For example SNMP::Info has an entry in its \f(CW%GLOBALS\fR hash for ``sysName'' instead of 1.3.6.1.2.1.1.5. .IP "\(bu" 4 Data returned is in the enumerated value form. .Sp For Example instead of looking up 1.3.6.1.2.1.2.2.1.3 and getting back \f(CW23\fR .Sp SNMP::Info will ask for \f(CW\*(C`RFC1213\-MIB::ifType\*(C'\fR and will get back \f(CW\*(C`ppp\*(C'\fR. .RE .RS 4 .RE .IP "2. SNMP::Info is easily extended to new devices" 4 .IX Item "2. SNMP::Info is easily extended to new devices" You can create a new subclass for a device by providing four hashes : \&\f(CW%GLOBALS\fR, \f(CW%MIBS\fR, \f(CW%FUNCS\fR, and \f(CW%MUNGE\fR. .Sp Or you can override any existing methods from a parent class by making a short subroutine. .Sp See the section \s-1EXTENDING SNMP::INFO\s0 for more details. .Sp When you make a new subclass for a device, please be sure to send it back to the developers (via Source Forge or the mailing list) for inclusion in the next version. .SH "SUBCLASSES" .IX Header "SUBCLASSES" These are the subclasses that implement MIBs and support devices: .PP Required MIBs not included in the install instructions above are noted here. .SS "\s-1MIB\s0 Subclasses" .IX Subsection "MIB Subclasses" These subclasses implement method to access one or more MIBs. These are not used directly, but rather inherited from device subclasses. .PP For more info run \f(CW\*(C`perldoc\*(C'\fR on any of the following module names. .IP "SNMP::Info::AdslLine" 4 .IX Item "SNMP::Info::AdslLine" \&\s-1SNMP\s0 Interface to the ADSL-LINE-MIB for \s-1ADSL\s0 interfaces. .Sp Requires the \fIADSL-LINE-MIB\fR, down loadable from Cisco. .Sp See documentation in SNMP::Info::AdslLine for details. .IP "SNMP::Info::Aggregate" 4 .IX Item "SNMP::Info::Aggregate" \&\s-1SNMP\s0 Interface to \fIIF-MIB\fR \f(CW\*(C`ifStackTable\*(C'\fR Aggregated Links .Sp See documentation in SNMP::Info::Aggregate for details. .IP "SNMP::Info::Airespace" 4 .IX Item "SNMP::Info::Airespace" \&\fIAIRESPACE-WIRELESS-MIB\fR and \fIAIRESPACE-SWITCHING-MIB\fR. Inherited by devices based on the Airespace wireless platform. .Sp See documentation in SNMP::Info::Airespace for details. .IP "SNMP::Info::AMAP" 4 .IX Item "SNMP::Info::AMAP" \&\fI\s-1ALCATEL\-IND1\-INTERSWITCH\-PROTOCOL\-MIB\s0\fR. Alcatel Mapping Adjacency Protocol (\s-1AMAP\s0) Support. .Sp See documentation in SNMP::Info::AMAP for details. .IP "SNMP::Info::Bridge" 4 .IX Item "SNMP::Info::Bridge" \&\fIBRIDGE-MIB\fR (\s-1RFC1286\s0). \fIQBRIDGE-MIB\fR. Inherited by devices with Layer2 support. .Sp See documentation in SNMP::Info::Bridge for details. .IP "SNMP::Info::CiscoAgg" 4 .IX Item "SNMP::Info::CiscoAgg" \&\s-1SNMP\s0 Interface to Cisco Aggregated Links .Sp See documentation in SNMP::Info::CiscoAgg for details. .IP "SNMP::Info::CDP" 4 .IX Item "SNMP::Info::CDP" \&\fICISCO-CDP-MIB\fR. Cisco Discovery Protocol (\s-1CDP\s0) Support. Inherited by Cisco, Enterasys, and \s-1HP\s0 devices. .Sp See documentation in SNMP::Info::CDP for details. .IP "SNMP::Info::CiscoConfig" 4 .IX Item "SNMP::Info::CiscoConfig" \&\fICISCO-CONFIG-COPY-MIB\fR, \fICISCO-FLASH-MIB\fR, and \fIOLD-CISCO-SYS-MIB\fR. These OIDs facilitate the writing of configuration files. .Sp See documentation in SNMP::Info::CiscoConfig for details. .IP "SNMP::Info::CiscoPortSecurity" 4 .IX Item "SNMP::Info::CiscoPortSecurity" \&\fICISCO-PORT-SECURITY-MIB\fR and \fICISCO-PAE-MIB\fR. .Sp See documentation in SNMP::Info::CiscoPortSecurity for details. .IP "SNMP::Info::CiscoPower" 4 .IX Item "SNMP::Info::CiscoPower" \&\fICISCO-POWER-ETHERNET-EXT-MIB\fR. .Sp See documentation in SNMP::Info::CiscoPower for details. .IP "SNMP::Info::CiscoQOS" 4 .IX Item "SNMP::Info::CiscoQOS" \&\fICISCO-CLASS-BASED-QOS-MIB\fR. A collection of OIDs providing information about a Cisco device's \s-1QOS\s0 config. .Sp See documentation in SNMP::Info::CiscoQOS for details. .IP "SNMP::Info::CiscoRTT" 4 .IX Item "SNMP::Info::CiscoRTT" \&\fICISCO-RTTMON-MIB\fR. A collection of OIDs providing information about a Cisco device's \s-1RTT\s0 values. .Sp See documentation in SNMP::Info::CiscoRTT for details. .IP "SNMP::Info::CiscoStack" 4 .IX Item "SNMP::Info::CiscoStack" \&\fICISCO-STACK-MIB\fR. .Sp See documentation in SNMP::Info::CiscoStack for details. .IP "SNMP::Info::CiscoStpExtensions" 4 .IX Item "SNMP::Info::CiscoStpExtensions" \&\fICISCO-STP-EXTENSIONS-MIB\fR .Sp See documentation in SNMP::Info::CiscoStpExtensions for details. .IP "SNMP::Info::CiscoStats" 4 .IX Item "SNMP::Info::CiscoStats" \&\fIOLD-CISCO-CPU-MIB\fR, \fICISCO-PROCESS-MIB\fR, and \fICISCO-MEMORY-POOL-MIB\fR. Provides common interfaces for memory, cpu, and os statistics for Cisco devices. .Sp See documentation in SNMP::Info::CiscoStats for details. .IP "SNMP::Info::CiscoVTP" 4 .IX Item "SNMP::Info::CiscoVTP" \&\fICISCO-VTP-MIB\fR, \fICISCO-VLAN-MEMBERSHIP-MIB\fR, \&\fICISCO-VLAN-IFTABLE-RELATIONSHIP-MIB\fR .Sp See documentation in SNMP::Info::CiscoVTP for details. .IP "SNMP::Info::EDP" 4 .IX Item "SNMP::Info::EDP" Extreme Discovery Protocol. \fIEXTREME-EDP-MIB\fR .Sp See documentation in SNMP::Info::EDP for details. .IP "SNMP::Info::Entity" 4 .IX Item "SNMP::Info::Entity" \&\fIENTITY-MIB\fR. Used for device info in Cisco and other vendors. .Sp See documentation in SNMP::Info::Entity for details. .IP "SNMP::Info::EtherLike" 4 .IX Item "SNMP::Info::EtherLike" \&\fIEtherLike-MIB\fR (\s-1RFC1398\s0) \- Some Layer3 devices implement this \s-1MIB,\s0 as well as some Aironet Layer 2 devices (non Cisco). .Sp See documentation in SNMP::Info::EtherLike for details. .IP "SNMP::Info::FDP" 4 .IX Item "SNMP::Info::FDP" Foundry (Brocade) Discovery Protocol. \fIFOUNDRY-SN-SWITCH-GROUP-MIB\fR .Sp See documentation in SNMP::Info::FDP for details. .IP "SNMP::Info::IPv6" 4 .IX Item "SNMP::Info::IPv6" \&\s-1SNMP\s0 Interface for obtaining configured IPv6 addresses and mapping IPv6 addresses to \s-1MAC\s0 addresses and interfaces, using information from \fIIP-MIB\fR, \&\fI\s-1IPV6\-MIB\s0\fR and/or \fICISCO-IETF-IP-MIB\fR. .Sp See documentation in SNMP::Info::IPv6 for details. .IP "SNMP::Info::IEEE802dot11" 4 .IX Item "SNMP::Info::IEEE802dot11" \&\fIIEEE802dot11\-MIB\fR. A collection of OIDs providing information about standards based 802.11 wireless devices. .Sp See documentation in SNMP::Info::IEEE802dot11 for details. .IP "SNMP::Info::IEEE802dot3ad" 4 .IX Item "SNMP::Info::IEEE802dot3ad" \&\s-1SNMP\s0 Interface to \s-1IEEE\s0 Aggregated Links. \fI\s-1IEEE8023\-LAG\-MIB\s0\fR .Sp See documentation in SNMP::Info::IEEE802dot3ad for details. .IP "SNMP::Info::LLDP" 4 .IX Item "SNMP::Info::LLDP" \&\fILLDP-MIB\fR, \fI\s-1LLDP\-EXT\-DOT1\-MIB\s0\fR, and \fI\s-1LLDP\-EXT\-DOT3\-MIB\s0\fR. Link Layer Discovery Protocol (\s-1LLDP\s0) Support. .Sp See documentation in SNMP::Info::LLDP for details. .IP "SNMP::Info::MAU" 4 .IX Item "SNMP::Info::MAU" \&\fIMAU-MIB\fR (\s-1RFC2668\s0). Some Layer2 devices use this for extended Ethernet (Media Access Unit) interface information. .Sp See documentation in SNMP::Info::MAU for details. .IP "SNMP::Info::MRO" 4 .IX Item "SNMP::Info::MRO" Method resolution introspection for SNMP::Info .Sp See documentation in SNMP::Info::MRO for details. .IP "SNMP::Info::NortelStack" 4 .IX Item "SNMP::Info::NortelStack" \&\fIS5\-AGENT\-MIB\fR, \fIS5\-CHASSIS\-MIB\fR. .Sp See documentation in SNMP::Info::NortelStack for details. .IP "SNMP::Info::PowerEthernet" 4 .IX Item "SNMP::Info::PowerEthernet" \&\fIPOWER-ETHERNET-MIB\fR .Sp See documentation in SNMP::Info::PowerEthernet for details. .IP "SNMP::Info::RapidCity" 4 .IX Item "SNMP::Info::RapidCity" \&\fIRAPID-CITY\fR. Inherited by Avaya switches for duplex and \s-1VLAN\s0 information. .Sp See documentation in SNMP::Info::RapidCity for details. .IP "SNMP::Info::SONMP" 4 .IX Item "SNMP::Info::SONMP" SynOptics Network Management Protocol (\s-1SONMP\s0) \fISYNOPTICS-ROOT-MIB\fR, \&\fIS5\-ETH\-MULTISEG\-TOPOLOGY\-MIB\fR. Inherited by Avaya/Nortel/Bay/Synoptics switches and hubs. .Sp See documentation in SNMP::Info::SONMP for details. .SS "Device Subclasses" .IX Subsection "Device Subclasses" These subclasses inherit from one or more classes to provide a common interface to data obtainable from network devices. .PP All the required \s-1MIB\s0 files are included in the netdisco-mib package. (See Above). .IP "SNMP::Info::Layer1" 4 .IX Item "SNMP::Info::Layer1" Generic Layer1 Device subclass. .Sp See documentation in SNMP::Info::Layer1 for details. .RS 4 .IP "SNMP::Info::Layer1::Allied" 4 .IX Item "SNMP::Info::Layer1::Allied" Subclass for Allied Telesis Repeaters / Hubs. .Sp Requires \fIATI-MIB\fR .Sp See documentation in SNMP::Info::Layer1::Allied for details. .IP "SNMP::Info::Layer1::Asante" 4 .IX Item "SNMP::Info::Layer1::Asante" Subclass for Asante 1012 Hubs. .Sp Requires \fI\s-1ASANTE\-HUB1012\-MIB\s0\fR .Sp See documentation in SNMP::Info::Layer1::Asante for details. .IP "SNMP::Info::Layer1::Bayhub" 4 .IX Item "SNMP::Info::Layer1::Bayhub" Subclass for Nortel/Bay hubs. This includes System 5000, 100 series, 200 series, and probably more. .Sp See documentation in SNMP::Info::Layer1::Bayhub for details. .IP "SNMP::Info::Layer1::Cyclades" 4 .IX Item "SNMP::Info::Layer1::Cyclades" Subclass for Cyclades terminal servers. .Sp See documentation in SNMP::Info::Layer1::Cyclades for details. .IP "SNMP::Info::Layer1::S3000" 4 .IX Item "SNMP::Info::Layer1::S3000" Subclass for Bay/Synoptics hubs. This includes System 3000, 281X, and probably more. .Sp See documentation in SNMP::Info::Layer1::S3000 for details. .RE .RS 4 .RE .IP "SNMP::Info::Layer2" 4 .IX Item "SNMP::Info::Layer2" Generic Layer2 Device subclass. .Sp See documentation in SNMP::Info::Layer2 for details. .RS 4 .IP "SNMP::Info::Layer2::3Com" 4 .IX Item "SNMP::Info::Layer2::3Com" SNMP::Info::Layer2::3Com \- \s-1SNMP\s0 Interface to L2 3Com Switches .Sp See documentation in SNMP::Info::Layer2::3Com for details. .IP "SNMP::Info::Layer2::Airespace" 4 .IX Item "SNMP::Info::Layer2::Airespace" Subclass for Cisco (Airespace) wireless controllers. .Sp See documentation in SNMP::Info::Layer2::Airespace for details. .IP "SNMP::Info::Layer2::Aironet" 4 .IX Item "SNMP::Info::Layer2::Aironet" Class for Cisco Aironet wireless devices that run \s-1IOS. \s0 See also Layer3::Aironet for Aironet devices that don't run \s-1IOS.\s0 .Sp See documentation in SNMP::Info::Layer2::Aironet for details. .IP "SNMP::Info::Layer2::Allied" 4 .IX Item "SNMP::Info::Layer2::Allied" Allied Telesis switches. .Sp See documentation in SNMP::Info::Layer2::Allied for details. .IP "SNMP::Info::Layer2::Baystack" 4 .IX Item "SNMP::Info::Layer2::Baystack" Subclass for Avaya/Nortel/Bay Ethernet Switch/Baystack switches. This includes 303, 304, 350, 380, 410, 420, 425, 450, 460, 470 series, 2500 series, 4000 series, 5000 series, Business Ethernet Switch (\s-1BES\s0), Business Policy Switch (\s-1BPS\s0), \s-1VSP 7000\s0 series, and probably others. .Sp See documentation in SNMP::Info::Layer2::Baystack for details. .IP "SNMP::Info::Layer2::Kentrox" 4 .IX Item "SNMP::Info::Layer2::Kentrox" Class for Kentrox DataSMART \s-1DSU/CSU.\s0 See SNMP::Info::Layer2::Kentrox for details. .IP "SNMP::Info::Layer2::C1900" 4 .IX Item "SNMP::Info::Layer2::C1900" Subclass for Cisco Catalyst 1900 and 1900c Devices running CatOS. .Sp See documentation in SNMP::Info::Layer2::C1900 for details. .IP "SNMP::Info::Layer2::C2900" 4 .IX Item "SNMP::Info::Layer2::C2900" Subclass for Cisco Catalyst 2900, 2950, 3500XL, and 3548 devices running \s-1IOS.\s0 .Sp See documentation in SNMP::Info::Layer2::C2900 for details. .IP "SNMP::Info::Layer2::Catalyst" 4 .IX Item "SNMP::Info::Layer2::Catalyst" Subclass for Cisco Catalyst switches running CatOS. These switches usually report a model number that starts with \f(CW\*(C`wsc\*(C'\fR. Note that this class does not support everything that has the name Catalyst. .Sp See documentation in SNMP::Info::Layer2::Catalyst for details. .IP "SNMP::Info::Layer2::Centillion" 4 .IX Item "SNMP::Info::Layer2::Centillion" Subclass for Nortel/Bay Centillion and 5000BH \s-1ATM\s0 switches. .Sp See documentation in SNMP::Info::Layer2::Centillion for details. .IP "SNMP::Info::Layer2::Cisco" 4 .IX Item "SNMP::Info::Layer2::Cisco" Generic Cisco subclass for layer 2 devices that are not yet supported in more specific subclassesand the base layer 2 Cisco class for other device specific layer 2 Cisco classes. .Sp See documentation in SNMP::Info::Layer2::Cisco for details. .IP "SNMP::Info::Layer2::CiscoSB" 4 .IX Item "SNMP::Info::Layer2::CiscoSB" Subclass for Cisco's \*(L"Small Business\*(R" product line, acquired from Linksys. This currently comprises the Sx300/500 line of switches. .Sp See documentation in SNMP::Info::Layer2::CiscoSB for details. .IP "SNMP::Info::Layer2::HP" 4 .IX Item "SNMP::Info::Layer2::HP" Subclass for more recent \s-1HP\s0 Procurve Switches .Sp Requires \fIHP-ICF-OID\fR and \fIENTITY-MIB\fR downloaded from \s-1HP. \s0 .Sp See documentation in SNMP::Info::Layer2::HP for details. .IP "SNMP::Info::Layer2::HP4000" 4 .IX Item "SNMP::Info::Layer2::HP4000" Subclass for older \s-1HP\s0 Procurve Switches .Sp Requires \fIHP-ICF-OID\fR and \fIENTITY-MIB\fR downloaded from \s-1HP. \s0 .Sp See documentation in SNMP::Info::Layer2::HP4000 for details. .IP "SNMP::Info::Layer2::HPVC" 4 .IX Item "SNMP::Info::Layer2::HPVC" Subclass for \s-1HP\s0 Virtual Connect Switches .Sp See documentation in SNMP::Info::Layer2::HPVC for details. .IP "SNMP::Info::Layer2::N2270" 4 .IX Item "SNMP::Info::Layer2::N2270" Subclass for Nortel 2270 wireless switches. .Sp See documentation in SNMP::Info::Layer2::N2270 for details. .IP "SNMP::Info::Layer2::NAP222x" 4 .IX Item "SNMP::Info::Layer2::NAP222x" Subclass for Nortel 222x series wireless access points. .Sp See documentation in SNMP::Info::Layer2::NAP222x for details. .IP "SNMP::Info::Layer2::Netgear" 4 .IX Item "SNMP::Info::Layer2::Netgear" Subclass for Netgear switches .Sp See documentation in SNMP::Info::Layer2::Netgear for details. .IP "SNMP::Info::Layer2::NWSS2300" 4 .IX Item "SNMP::Info::Layer2::NWSS2300" \&\s-1SNMP\s0 Interface to Avaya (Trapeze) Wireless Controllers .Sp See documentation in SNMP::Info::Layer2::NWSS2300 for details. .IP "SNMP::Info::Layer2::Orinoco" 4 .IX Item "SNMP::Info::Layer2::Orinoco" Subclass for Orinoco/Proxim wireless access points. .Sp See documentation in SNMP::Info::Layer2::Orinoco for details. .IP "SNMP::Info::Layer2::Trapeze" 4 .IX Item "SNMP::Info::Layer2::Trapeze" \&\s-1SNMP\s0 Interface to Juniper (Trapeze) Wireless Controllers .Sp See documentation in SNMP::Info::Layer2::Trapeze for details. .IP "SNMP::Info::Layer2::Ubiquiti" 4 .IX Item "SNMP::Info::Layer2::Ubiquiti" \&\s-1SNMP\s0 Interface to Ubiquiti Access Points .Sp See documentation in SNMP::Info::Layer2::Ubiquiti for details. .IP "SNMP::Info::Layer2::ZyXEL_DSLAM" 4 .IX Item "SNMP::Info::Layer2::ZyXEL_DSLAM" Zyxel DSLAMs. Need I say more? .Sp See documentation in SNMP::Info::Layer2::ZyXEL_DSLAM for details. .RE .RS 4 .RE .IP "SNMP::Info::Layer3" 4 .IX Item "SNMP::Info::Layer3" Generic Layer3 and Layer2+3 Device subclass. .Sp See documentation in SNMP::Info::Layer3 for details. .RS 4 .IP "SNMP::Info::Layer3::Aironet" 4 .IX Item "SNMP::Info::Layer3::Aironet" Subclass for Cisco Aironet wireless access points (\s-1AP\s0) not running \s-1IOS.\s0 These are usually older devices. .Sp MIBs for these devices now included in v2.tar.gz available from ftp.cisco.com. .Sp Note Layer2::Aironet .Sp See documentation in SNMP::Info::Layer3::Aironet for details. .IP "SNMP::Info::Layer3::AlcatelLucent" 4 .IX Item "SNMP::Info::Layer3::AlcatelLucent" Alcatel-Lucent OmniSwitch Class. .Sp See documentation in SNMP::Info::Layer3::AlcatelLucent for details. .IP "SNMP::Info::Layer3::AlteonAD" 4 .IX Item "SNMP::Info::Layer3::AlteonAD" Subclass for Radware Alteon Series \s-1ADC\s0 switches and Nortel BladeCenter Layer2\-3 GbE Switch Modules. .Sp See documentation in SNMP::Info::Layer3::AlteonAD for details. .IP "SNMP::Info::Layer3::Altiga" 4 .IX Item "SNMP::Info::Layer3::Altiga" See documentation in SNMP::Info::Layer3::Altiga for details. .IP "SNMP::Info::Layer3::Arista" 4 .IX Item "SNMP::Info::Layer3::Arista" See documentation in SNMP::Info::Layer3::Arista for details. .IP "SNMP::Info::Layer3::Aruba" 4 .IX Item "SNMP::Info::Layer3::Aruba" Subclass for Aruba wireless switches. .Sp See documentation in SNMP::Info::Layer3::Aruba for details. .IP "SNMP::Info::Layer3::BayRS" 4 .IX Item "SNMP::Info::Layer3::BayRS" Subclass for Avaya/Nortel/Bay Multiprotocol/BayRS routers. This includes \&\s-1BCN, BLN, ASN, ARN, AN, 2430,\s0 and 5430 routers. .Sp See documentation in SNMP::Info::Layer3::BayRS for details. .IP "SNMP::Info::Layer3::BlueCoatSG" 4 .IX Item "SNMP::Info::Layer3::BlueCoatSG" Subclass for Blue Coat \s-1SG\s0 series proxy devices. .Sp See documentation in SNMP::Info::Layer3::BlueCoatSG for details. .IP "SNMP::Info::Layer3::C3550" 4 .IX Item "SNMP::Info::Layer3::C3550" Subclass for Cisco Catalyst 3550,3540,3560 2/3 switches running \s-1IOS.\s0 .Sp See documentation in SNMP::Info::Layer3::C3550 for details. .IP "SNMP::Info::Layer3::C4000" 4 .IX Item "SNMP::Info::Layer3::C4000" This class covers Catalyst 4000s and 4500s. .Sp See documentation in SNMP::Info::Layer3::C4000 for details. .IP "SNMP::Info::Layer3::C6500" 4 .IX Item "SNMP::Info::Layer3::C6500" This class covers Catalyst 6500s in native mode, hybrid mode. Catalyst 3750's, 2970's and probably others. .Sp See documentation in SNMP::Info::Layer3::C6500 for details. .IP "SNMP::Info::Layer3::Cisco" 4 .IX Item "SNMP::Info::Layer3::Cisco" This is a simple wrapper around layer 3 for \s-1IOS\s0 devices and the base layer 3 Cisco class for other device specific layer 3 Cisco classes. .Sp See documentation in SNMP::Info::Layer3::Cisco for details. .IP "SNMP::Info::Layer3::CiscoASA" 4 .IX Item "SNMP::Info::Layer3::CiscoASA" Subclass for Cisco Adaptive Security Appliances. .Sp See documentation in SNMP::Info::Layer3::CiscoASA for details. .IP "SNMP::Info::Layer3::CiscoFWSM" 4 .IX Item "SNMP::Info::Layer3::CiscoFWSM" Subclass for Cisco Firewall Services Modules. .Sp See documentation in SNMP::Info::Layer3::CiscoFWSM for details. .IP "SNMP::Info::Layer3::CiscoSwitch" 4 .IX Item "SNMP::Info::Layer3::CiscoSwitch" Base class for L3 Cisco switches. See documentation in SNMP::Info::Layer3::CiscoSwitch for details. .IP "SNMP::Info::Layer3::Contivity" 4 .IX Item "SNMP::Info::Layer3::Contivity" Subclass for Avaya/Nortel Contivity/VPN Routers. .Sp See documentation in SNMP::Info::Layer3::Contivity for details. .IP "SNMP::Info::Layer3::Dell" 4 .IX Item "SNMP::Info::Layer3::Dell" Subclass for Dell PowerConnect switches. D\-Link, the \s-1IBM\s0 BladeCenter Gigabit Ethernet Switch Module and some Linksys switches also use this module based upon \s-1MIB\s0 support. .Sp See documentation in SNMP::Info::Layer3::Dell for details. .IP "SNMP::Info::Layer3::Enterasys" 4 .IX Item "SNMP::Info::Layer3::Enterasys" Subclass for Enterasys devices. .Sp See documentation in SNMP::Info::Layer3::Enterasys for details. .IP "SNMP::Info::Layer3::Extreme" 4 .IX Item "SNMP::Info::Layer3::Extreme" Subclass for Extreme Networks switches. .Sp See documentation in SNMP::Info::Layer3::Extreme for details. .IP "SNMP::Info::Layer3::F5" 4 .IX Item "SNMP::Info::Layer3::F5" Subclass for F5 devices. .Sp See documentation in SNMP::Info::Layer3::F5 for details. .IP "SNMP::Info::Layer3::Force10" 4 .IX Item "SNMP::Info::Layer3::Force10" Subclass for Force10 devices. .Sp See documentation in SNMP::Info::Layer3::Force10 for details. .IP "SNMP::Info::Layer3::Fortinet" 4 .IX Item "SNMP::Info::Layer3::Fortinet" Subclass for Fortinet devices. .Sp See documentation in SNMP::Info::Layer3::Fortinet for details. .IP "SNMP::Info::Layer3::Foundry" 4 .IX Item "SNMP::Info::Layer3::Foundry" Subclass for Brocade (Foundry) Network devices. .Sp See documentation in SNMP::Info::Layer3::Foundry for details. .IP "SNMP::Info::Layer3::H3C" 4 .IX Item "SNMP::Info::Layer3::H3C" \&\s-1SNMP\s0 Interface to Layer 3 Devices, H3C & \s-1HP\s0 A\-series. .Sp See documentation in SNMP::Info::Layer3::H3C for details. .IP "SNMP::Info::Layer3::HP9300" 4 .IX Item "SNMP::Info::Layer3::HP9300" Subclass for \s-1HP\s0 network devices which Foundry Networks was the Original Equipment Manufacturer (\s-1OEM\s0) such as the \s-1HP\s0 ProCurve 9300 and 6300 series. .Sp See documentation in SNMP::Info::Layer3::HP9300 for details. .IP "SNMP::Info::Layer3::Huawei" 4 .IX Item "SNMP::Info::Layer3::Huawei" \&\s-1SNMP\s0 Interface to Huawei Layer 3 switches and routers. .Sp See documentation in SNMP::Info::Layer3::Huawei for details. .IP "SNMP::Info::Layer3::IBMGbTor" 4 .IX Item "SNMP::Info::Layer3::IBMGbTor" \&\s-1SNMP\s0 Interface to \s-1IBM\s0 Rackswitch (formerly Blade Network Technologies) network devices. .Sp See documentation in SNMP::Info::Layer3::IBMGbTor for details. .IP "SNMP::Info::Layer3::Juniper" 4 .IX Item "SNMP::Info::Layer3::Juniper" Subclass for Juniper devices .Sp See documentation in SNMP::Info::Layer3::Juniper for details. .IP "SNMP::Info::Layer3::Lantronix" 4 .IX Item "SNMP::Info::Layer3::Lantronix" Subclass for Lantronix devices .Sp See documentation in SNMP::Info::Layer3::Lantronix for details. .IP "SNMP::Info::Layer3::Microsoft" 4 .IX Item "SNMP::Info::Layer3::Microsoft" Subclass for Generic Microsoft Routers running Microsoft Windows \s-1OS.\s0 .Sp See documentation in SNMP::Info::Layer3::Microsoft for details. .IP "SNMP::Info::Layer3::Mikrotik" 4 .IX Item "SNMP::Info::Layer3::Mikrotik" Subclass for Mikrotik devices running RouterOS. .Sp See documentation in SNMP::Info::Layer3::Mikrotik for details. .IP "SNMP::Info::Layer3::N1600" 4 .IX Item "SNMP::Info::Layer3::N1600" Subclass for Avaya/Nortel Ethernet Routing Switch 1600 series. .Sp See documentation in SNMP::Info::Layer3::N1600 for details. .IP "SNMP::Info::Layer3::NetSNMP" 4 .IX Item "SNMP::Info::Layer3::NetSNMP" Subclass for host systems running Net-SNMP. .Sp See documentation in SNMP::Info::Layer3::NetSNMP for details. .IP "SNMP::Info::Layer3::Netscreen" 4 .IX Item "SNMP::Info::Layer3::Netscreen" Subclass for Juniper NetScreen. .Sp See documentation in SNMP::Info::Layer3::Netscreen for details. .IP "SNMP::Info::Layer3::Nexus" 4 .IX Item "SNMP::Info::Layer3::Nexus" Subclass for Cisco Nexus devices running NX-OS .Sp See documentation in SNMP::Info::Layer3::Nexus for details. .IP "SNMP::Info::Layer3::PacketFront" 4 .IX Item "SNMP::Info::Layer3::PacketFront" Subclass for PacketFront \s-1DRG\s0 series \s-1CPE.\s0 .Sp See documentation in SNMP::Info::Layer3::PacketFront for details. .IP "SNMP::Info::Layer3::PaloAlto" 4 .IX Item "SNMP::Info::Layer3::PaloAlto" Subclass for Palo Alto firewalls. .Sp See documentation in SNMP::Info::Layer3::PaloAlto for details. .IP "SNMP::Info::Layer3::Passport" 4 .IX Item "SNMP::Info::Layer3::Passport" Subclass for Avaya/Nortel Ethernet Routing Switch/Passport 8000 series, Accelar, and \s-1VSP 9000\s0 series switches. .Sp See documentation in SNMP::Info::Layer3::Passport for details. .IP "SNMP::Info::Layer3::Pf" 4 .IX Item "SNMP::Info::Layer3::Pf" Subclass for FreeBSD-Based Firewalls using Pf /Pf Sense .Sp See documentation in SNMP::Info::Layer3::Pf for details. .IP "SNMP::Info::Layer3::Pica8" 4 .IX Item "SNMP::Info::Layer3::Pica8" Subclass for Pica8 devices. .Sp See documentation in SNMP::Info::Layer3::Pica8 for details. .IP "SNMP::Info::Layer3::SonicWALL" 4 .IX Item "SNMP::Info::Layer3::SonicWALL" Subclass for generic SonicWALL devices. See documentation in SNMP::Info::Layer3::SonicWALL for details. .IP "SNMP::Info::Layer3::Steelhead" 4 .IX Item "SNMP::Info::Layer3::Steelhead" Subclass for Riverbed Steelhead \s-1WAN\s0 optimization appliances. See documentation in SNMP::Info::Layer3::Steelhead for details. .IP "SNMP::Info::Layer3::Sun" 4 .IX Item "SNMP::Info::Layer3::Sun" Subclass for Generic Sun Routers running SunOS. .Sp See documentation in SNMP::Info::Layer3::Sun for details. .IP "SNMP::Info::Layer3::Tasman" 4 .IX Item "SNMP::Info::Layer3::Tasman" Subclass for Avaya Secure Routers. .Sp See documentation in SNMP::Info::Layer3::Tasman for details. .IP "SNMP::Info::Layer3::Timetra" 4 .IX Item "SNMP::Info::Layer3::Timetra" Alcatel-Lucent \s-1SR\s0 Class. .Sp See documentation in SNMP::Info::Layer3::Timetra for details. .IP "SNMP::Info::Layer3::VMware" 4 .IX Item "SNMP::Info::Layer3::VMware" Subclass for VMware ESXi hosts. .Sp See documentation in SNMP::Info::Layer3::VMware for details. .RE .RS 4 .RE .IP "SNMP::Info::Layer7" 4 .IX Item "SNMP::Info::Layer7" Generic Layer7 Devices. .Sp See documentation in SNMP::Info::Layer7 for details. .RS 4 .IP "SNMP::Info::Layer7::APC" 4 .IX Item "SNMP::Info::Layer7::APC" \&\s-1SNMP\s0 Interface to \s-1APC UPS\s0 devices .Sp See documentation in SNMP::Info::Layer7::APC for details. .IP "SNMP::Info::Layer7::Netscaler" 4 .IX Item "SNMP::Info::Layer7::Netscaler" \&\s-1SNMP\s0 Interface to Citrix Netscaler appliances .Sp See documentation in SNMP::Info::Layer7::Netscaler for details. .IP "SNMP::Info::Layer7::Neoteris" 4 .IX Item "SNMP::Info::Layer7::Neoteris" \&\s-1SNMP\s0 Interface to Juniper \s-1SSL VPN\s0 appliances .Sp See documentation in SNMP::Info::Layer7::Neoteris for details. .RE .RS 4 .RE .SH "Thanks" .IX Header "Thanks" Thanks for testing and coding help (in no particular order) to : Alexander Barthel, Andy Ford, Alexander Hartmaier, Andrew Herrick, Alex Kramarov, Bernhard Augenstein, Bradley Baetz, Brian Chow, Brian Wilson, Carlos Vicente, Dana Watanabe, David Pinkoski, David Sieborger, Douglas McKeown, Greg King, Ivan Auger, Jean-Philippe Luiggi, Jeroen van Ingen, Justin Hunter, Kent Hamilton, Matthew Tuttle, Michael Robbert, Mike Hunter, Nicolai Petri, Ralf Gross, Robert Kerr and people listed on the Netdisco \&\s-1README\s0! .SH "USAGE" .IX Header "USAGE" .SS "Constructor" .IX Subsection "Constructor" .IP "\fInew()\fR" 4 .IX Item "new()" Creates a new object and connects via SNMP::Session. .Sp .Vb 12 \& my $info = new SNMP::Info( \*(AqDebug\*(Aq => 1, \& \*(AqAutoSpecify\*(Aq => 1, \& \*(AqBigInt\*(Aq => 1, \& \*(AqBulkWalk\*(Aq => 1, \& \*(AqBulkRepeaters\*(Aq => 20, \& \*(AqIgnoreNetSNMPConf\*(Aq => 1, \& \*(AqLoopDetect\*(Aq => 1, \& \*(AqDestHost\*(Aq => \*(Aqmyrouter\*(Aq, \& \*(AqCommunity\*(Aq => \*(Aqpublic\*(Aq, \& \*(AqVersion\*(Aq => 2, \& \*(AqMibDirs\*(Aq => [\*(Aqdir1\*(Aq,\*(Aqdir2\*(Aq,\*(Aqdir3\*(Aq], \& ) or die; .Ve .Sp SNMP::Info Specific Arguments : .RS 4 .IP "AutoSpecify" 4 .IX Item "AutoSpecify" Returns an object of a more specific device class .Sp (default 0, which means \*(L"off\*(R") .IP "BigInt" 4 .IX Item "BigInt" Return Math::BigInt objects for 64 bit counters. Sets on a global scope, not object. .Sp (default 0, which means \*(L"off\*(R") .IP "BulkWalk" 4 .IX Item "BulkWalk" Set to \f(CW0\fR to turn off \s-1BULKWALK\s0 commands for SNMPv2 connections. .Sp Note that \s-1BULKWALK\s0 is turned off for Net-SNMP versions 5.1.x because of a bug. .Sp (default 1, which means \*(L"on\*(R") .IP "BulkRepeaters" 4 .IX Item "BulkRepeaters" Set number of MaxRepeaters for \s-1BULKWALK\s0 operation. See \&\f(CW\*(C`perldoc SNMP\*(C'\fR \-> \fIbulkwalk()\fR for more info. .Sp (default 20) .IP "LoopDetect" 4 .IX Item "LoopDetect" Detects looping during getnext table column walks by comparing IIDs for each instance. A loop is detected if the same \s-1IID\s0 is seen more than once and the walk is aborted. Note: This will not detect loops during a bulkwalk operation, Net-SNMP's internal bulkwalk function must detect the loop. .Sp Set to \f(CW0\fR to turn off loop detection. .Sp (default 1, which means \*(L"on\*(R") .IP "IgnoreNetSNMPConf" 4 .IX Item "IgnoreNetSNMPConf" Net-SNMP version 5.0 and higher read configuration files, snmp.conf or snmp.local.conf, from /etc/snmp, /usr/share/snmp, /usr/lib(64)/snmp, or \&\f(CW$HOME\fR/.snmp and uses those settings to automatically parse \s-1MIB\s0 files, etc. .Sp Set to \f(CW1\fR \*(L"on\*(R" to ignore Net-SNMP configuration files by overriding the \&\f(CW\*(C`SNMPCONFPATH\*(C'\fR environmental variable during object initialization. Note: MibDirs must be defined or Net-SNMP will not be able to load MIBs and initialize the object. .Sp (default 0, which means \*(L"off\*(R") .IP "Debug" 4 .IX Item "Debug" Prints Lots of debugging messages. Pass 2 to print even more debugging messages. .Sp (default 0, which means \*(L"off\*(R") .IP "DebugSNMP" 4 .IX Item "DebugSNMP" Set \f(CW$SNMP::debugging\fR level for Net-SNMP. .Sp See \fI\s-1SNMP\s0\fR for more details. .IP "MibDirs" 4 .IX Item "MibDirs" Array ref to list of directories in which to look for MIBs. Note this will be in addition to the ones setup in snmp.conf at the system level. .Sp (default use net-snmp settings only) .IP "RetryNoSuch" 4 .IX Item "RetryNoSuch" When using \s-1SNMP\s0 Version 1, try reading values even if they come back as \*(L"no such variable in this \s-1MIB\*(R". \s0 Set to false if so desired. This feature lets you read SNMPv2 data from an \s-1SNMP\s0 version 1 connection, and should probably be left on. .Sp (default 1, which means \*(L"on\*(R") .IP "Session" 4 .IX Item "Session" SNMP::Session object to use instead of connecting on own. .Sp (default creates session automatically) .IP "Offline" 4 .IX Item "Offline" Causes SNMP::Info to avoid network activity and return data only from its cache. If you ask for something not in the cache, an error is thrown. See also the \f(CW\*(C`cache()\*(C'\fR and \f(CW\*(C`offline()\*(C'\fR methods. .Sp (default 0, which means \*(L"online\*(R") .IP "Cache" 4 .IX Item "Cache" Pass in a HashRef to prime the cache of retrieved data. Useful for creating an instance in \f(CW\*(C`Offline\*(C'\fR mode from a previously dumped cache. See also the \&\f(CW\*(C`cache()\*(C'\fR method to retrieve a cache after running actial queries. .IP "\s-1OTHER\s0" 4 .IX Item "OTHER" All other arguments are passed to SNMP::Session. .Sp See SNMP::Session for a list of other possible arguments. .RE .RS 4 .Sp A Note about the wrong Community string or wrong \s-1SNMP\s0 Version: .Sp If a connection is using the wrong community string or the wrong \s-1SNMP\s0 version, the creation of the object will not fail. The device still answers the call on the \s-1SNMP\s0 port, but will not return information. Check the \fIerror()\fR method after you create the device object to see if there was a problem in connecting. .Sp A note about \s-1SNMP\s0 Versions : .Sp Some older devices don't support \s-1SNMP\s0 version 2, and will not return anything when a connection under Version 2 is attempted. .Sp Some newer devices will support Version 1, but will not return all the data they might have if you had connected under Version 1 .Sp When trying to get info from a new device, you may have to try version 2 and then fallback to version 1. .RE .IP "\fIupdate()\fR" 4 .IX Item "update()" Replace the existing session with a new one with updated values, without re-identifying the device. The only supported changes are to Community or Context. .Sp Clears the object cache. .Sp This is useful, e.g., when a device supports multiple contexts (via changes to the Community string, or via the SNMPv3 Context parameter), but a context that you want to access does not support the objects (e.g., \f(CW\*(C`sysObjectID\*(C'\fR, \f(CW\*(C`sysDescr\*(C'\fR) that we use to identify the device. .SS "Data is Cached" .IX Subsection "Data is Cached" Methods and subroutines requesting data from a device will only load the data once, and then return cached versions of that data. .PP Run \f(CW$info\fR\->\fIload_METHOD()\fR where method is something like 'i_name' to reload data from a method. .PP Run \f(CW$info\fR\->\fIclear_cache()\fR to clear the cache to allow reload of both globals and table methods. .PP The cache can be retrieved or set using the \f(CW$info\fR\->\fIcache()\fR method. This works together with the \f(CW\*(C`Offline\*(C'\fR option. .SS "Object Scalar Methods" .IX Subsection "Object Scalar Methods" These are for package related data, not directly supplied from \s-1SNMP.\s0 .ie n .IP "$info\->\fIclear_cache()\fR" 4 .el .IP "\f(CW$info\fR\->\fIclear_cache()\fR" 4 .IX Item "$info->clear_cache()" Clears the cached data. This includes \s-1GLOBALS\s0 data and \s-1TABLE METHOD\s0 data. .ie n .IP "$info\->\fIdebug\fR\|(1)" 4 .el .IP "\f(CW$info\fR\->\fIdebug\fR\|(1)" 4 .IX Item "$info->debug" Returns current debug status, and optionally toggles debugging info for this object. .ie n .IP "$info\->offline([1|0])" 4 .el .IP "\f(CW$info\fR\->offline([1|0])" 4 .IX Item "$info->offline([1|0])" Returns if offline mode is currently turned on for this object. .Sp Optionally sets the Offline parameter. .ie n .IP "$info\->cache([new_cache])" 4 .el .IP "\f(CW$info\fR\->cache([new_cache])" 4 .IX Item "$info->cache([new_cache])" Returns a HashRef of all cached data in this object. There will be a \f(CW\*(C`store\*(C'\fR key for table data and then one key for each leaf. .Sp Optionally sets the cache parameters if passed a HashRef. .ie n .IP "$info\->bulkwalk([1|0])" 4 .el .IP "\f(CW$info\fR\->bulkwalk([1|0])" 4 .IX Item "$info->bulkwalk([1|0])" Returns if bulkwalk is currently turned on for this object. .Sp Optionally sets the bulkwalk parameter. .ie n .IP "$info\->loopdetect([1|0])" 4 .el .IP "\f(CW$info\fR\->loopdetect([1|0])" 4 .IX Item "$info->loopdetect([1|0])" Returns if loopdetect is currently turned on for this object. .Sp Optionally sets the loopdetect parameter. .ie n .IP "$info\->\fIdevice_type()\fR" 4 .el .IP "\f(CW$info\fR\->\fIdevice_type()\fR" 4 .IX Item "$info->device_type()" Returns the Subclass name for this device. \f(CW\*(C`SNMP::Info\*(C'\fR is returned if no more specific class is available. .Sp First the device is checked for Layer 3 support and a specific subclass, then Layer 2 support and subclasses are checked. .Sp This means that Layer 2 / 3 switches and routers will fall under the SNMP::Info::Layer3 subclasses. .Sp If the device still can be connected to via SNMP::Info, then SNMP::Info is returned. .ie n .IP "$info\->error(no_clear)" 4 .el .IP "\f(CW$info\fR\->error(no_clear)" 4 .IX Item "$info->error(no_clear)" Returns Error message if there is an error, or undef if there is not. .Sp Reading the error will clear the error unless you set the no_clear flag. .ie n .IP "$info\->\fIhas_layer\fR\|(3)" 4 .el .IP "\f(CW$info\fR\->\fIhas_layer\fR\|(3)" 4 .IX Item "$info->has_layer" Returns non-zero if the device has the supplied layer in the \s-1OSI\s0 Model .Sp Returns if the device doesn't support the \fIlayers()\fR call. .ie n .IP "$info\->\fIsnmp_comm()\fR" 4 .el .IP "\f(CW$info\fR\->\fIsnmp_comm()\fR" 4 .IX Item "$info->snmp_comm()" Returns \s-1SNMP\s0 Community string used in connection. .ie n .IP "$info\->\fIsnmp_ver()\fR" 4 .el .IP "\f(CW$info\fR\->\fIsnmp_ver()\fR" 4 .IX Item "$info->snmp_ver()" Returns \s-1SNMP\s0 Version used for this connection .ie n .IP "$info\->\fIspecify()\fR" 4 .el .IP "\f(CW$info\fR\->\fIspecify()\fR" 4 .IX Item "$info->specify()" Returns an object of a more-specific subclass. .Sp .Vb 3 \& my $info = new SNMP::Info(...); \& # Returns more specific object type \& $info = $info\->specific(); .Ve .Sp Usually this method is called internally from new(AutoSpecify => 1) .Sp See \fIdevice_type()\fR entry for how a subclass is chosen. .ie n .IP "$info\->\fIcisco_comm_indexing()\fR" 4 .el .IP "\f(CW$info\fR\->\fIcisco_comm_indexing()\fR" 4 .IX Item "$info->cisco_comm_indexing()" Returns 0. Is an overridable method used for vlan indexing for snmp calls on certain Cisco devices. .Sp See .SS "Globals (Scalar Methods)" .IX Subsection "Globals (Scalar Methods)" These are methods to return scalar data from \s-1RFC1213. \s0 .PP Some subset of these is probably available for any network device that speaks \&\s-1SNMP.\s0 .ie n .IP "$info\->\fIuptime()\fR" 4 .el .IP "\f(CW$info\fR\->\fIuptime()\fR" 4 .IX Item "$info->uptime()" Uptime in hundredths of seconds since device became available. .Sp (\f(CW\*(C`sysUpTime\*(C'\fR) .ie n .IP "$info\->\fIcontact()\fR" 4 .el .IP "\f(CW$info\fR\->\fIcontact()\fR" 4 .IX Item "$info->contact()" (\f(CW\*(C`sysContact\*(C'\fR) .ie n .IP "$info\->\fIname()\fR" 4 .el .IP "\f(CW$info\fR\->\fIname()\fR" 4 .IX Item "$info->name()" (\f(CW\*(C`sysName\*(C'\fR) .ie n .IP "$info\->\fIlocation()\fR" 4 .el .IP "\f(CW$info\fR\->\fIlocation()\fR" 4 .IX Item "$info->location()" (\f(CW\*(C`sysLocation\*(C'\fR) .ie n .IP "$info\->\fIlayers()\fR" 4 .el .IP "\f(CW$info\fR\->\fIlayers()\fR" 4 .IX Item "$info->layers()" This returns a binary encoded string where each digit represents a layer of the \s-1OSI\s0 model served by the device. .Sp .Vb 2 \& eg: 01000010 means layers 2 (physical) and 7 (Application) \& are served. .Ve .Sp Note: This string is 8 digits long. .Sp See \f(CW$info\fR\->\fIhas_layer()\fR .Sp (\f(CW\*(C`sysServices\*(C'\fR) .ie n .IP "$info\->\fIports()\fR" 4 .el .IP "\f(CW$info\fR\->\fIports()\fR" 4 .IX Item "$info->ports()" Number of interfaces available on this device. .Sp Not too useful as the number of \s-1SNMP\s0 interfaces usually does not correspond with the number of physical ports .Sp (\f(CW\*(C`ifNumber\*(C'\fR) .ie n .IP "$info\->\fIipforwarding()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipforwarding()\fR" 4 .IX Item "$info->ipforwarding()" The indication of whether the entity is acting as an \s-1IP\s0 gateway .Sp Returns either forwarding or not-forwarding .Sp (\f(CW\*(C`ipForwarding\*(C'\fR) .SS "Table Methods" .IX Subsection "Table Methods" Each of these methods returns a hash_reference to a hash keyed on the interface index in \s-1SNMP.\s0 .PP Example : \f(CW$info\fR\->\fIinterfaces()\fR might return .PP .Vb 4 \& { \*(Aq1.12\*(Aq => \*(AqFastEthernet/0\*(Aq, \& \*(Aq2.15\*(Aq => \*(AqFastEthernet/1\*(Aq, \& \*(Aq9.99\*(Aq => \*(AqFastEthernet/2\*(Aq \& } .Ve .PP 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. .SS "Partial Table Fetches" .IX Subsection "Partial Table Fetches" If you want to get only a part of an \s-1SNMP\s0 table or a single instance from the table and you know the \s-1IID\s0 for the part of the table that you want, you can specify it in the call: .PP .Vb 1 \& $local_routes = $info\->ipr_route(\*(Aq192.168.0\*(Aq); .Ve .PP This will only fetch entries in the table that start with \f(CW192.168.0\fR, which in this case are routes on the local network. .PP Remember that you must supply the partial \s-1IID \s0(a numeric \s-1OID\s0). .PP Partial table results are not cached. .SS "Interface Information" .IX Subsection "Interface Information" .ie n .IP "$info\->\fIinterfaces()\fR" 4 .el .IP "\f(CW$info\fR\->\fIinterfaces()\fR" 4 .IX Item "$info->interfaces()" This methods is overridden in each subclass to provide a mapping between the Interface Table Index (iid) and the physical port name. .ie n .IP "$info\->\fIif_ignore()\fR" 4 .el .IP "\f(CW$info\fR\->\fIif_ignore()\fR" 4 .IX Item "$info->if_ignore()" Returns a reference to a hash where key values that exist are interfaces to ignore. .Sp Ignored interfaces are ones that are usually not physical ports or Virtual Lans (VLANs) such as the Loopback interface, or the \s-1CPU\s0 interface. .ie n .IP "$info\->\fIbulkwalk_no()\fR" 4 .el .IP "\f(CW$info\fR\->\fIbulkwalk_no()\fR" 4 .IX Item "$info->bulkwalk_no()" Returns 0. Is an overridable method used for turn off bulkwalk for the device class. .ie n .IP "$info\->\fIi_index()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_index()\fR" 4 .IX Item "$info->i_index()" Default \s-1SNMP IID\s0 to Interface index. .Sp (\f(CW\*(C`ifIndex\*(C'\fR) .ie n .IP "$info\->\fIi_description()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_description()\fR" 4 .IX Item "$info->i_description()" Description of the interface. Usually a little longer single word name that is both human and machine friendly. Not always. .Sp (\f(CW\*(C`ifDescr\*(C'\fR) .ie n .IP "$info\->\fIi_type()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_type()\fR" 4 .IX Item "$info->i_type()" Interface type, such as Vlan, Ethernet, Serial .Sp (\f(CW\*(C`ifType\*(C'\fR) .ie n .IP "$info\->\fIi_mtu()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_mtu()\fR" 4 .IX Item "$info->i_mtu()" \&\s-1INTEGER.\s0 Interface \s-1MTU\s0 value. .Sp (\f(CW\*(C`ifMtu\*(C'\fR) .ie n .IP "$info\->\fIi_speed()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_speed()\fR" 4 .IX Item "$info->i_speed()" Speed of the link, human format. See \fImunge_speed()\fR later in document for details. .Sp (\f(CW\*(C`ifSpeed\*(C'\fR, \f(CW\*(C`ifHighSpeed\*(C'\fR if necessary) .ie n .IP "$info\->\fIi_speed_raw()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_speed_raw()\fR" 4 .IX Item "$info->i_speed_raw()" Speed of the link in bits per second without munging. If i_speed_high is available it will be used and multiplied by 1_000_000. .Sp (\f(CW\*(C`ifSpeed\*(C'\fR, \f(CW\*(C`ifHighSpeed\*(C'\fR if necessary) .ie n .IP "$info\->\fIi_speed_high()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_speed_high()\fR" 4 .IX Item "$info->i_speed_high()" Speed of a high-speed link, human format. See \fImunge_highspeed()\fR later in document for details. You should not need to call this directly, as \&\fIi_speed()\fR will call it if it needs to. .Sp (\f(CW\*(C`ifHighSpeed\*(C'\fR) .ie n .IP "$info\->\fIi_mac()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_mac()\fR" 4 .IX Item "$info->i_mac()" \&\s-1MAC\s0 address of the interface. Note this is just the \s-1MAC\s0 of the port, not anything connected to it. .Sp (\f(CW\*(C`ifPhysAddress\*(C'\fR) .ie n .IP "$info\->\fIi_up()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_up()\fR" 4 .IX Item "$info->i_up()" Link Status of the interface. Typical values are 'up' and 'down'. .Sp (\f(CW\*(C`ifOperStatus\*(C'\fR) .ie n .IP "$info\->\fIi_up_admin()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_up_admin()\fR" 4 .IX Item "$info->i_up_admin()" Administrative status of the port. Typical values are 'enabled' and 'disabled'. .Sp (\f(CW\*(C`ifAdminStatus\*(C'\fR) .ie n .IP "$info\->\fIi_lastchange()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_lastchange()\fR" 4 .IX Item "$info->i_lastchange()" The value of \f(CW\*(C`sysUpTime\*(C'\fR when this port last changed states (up,down). .Sp (\f(CW\*(C`ifLastChange\*(C'\fR) .ie n .IP "$info\->\fIi_name()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_name()\fR" 4 .IX Item "$info->i_name()" Interface Name field. Supported by a smaller subset of devices, this fields is often human set. .Sp (\f(CW\*(C`ifName\*(C'\fR) .ie n .IP "$info\->\fIi_alias()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_alias()\fR" 4 .IX Item "$info->i_alias()" Interface Name field. For certain devices this is a more human friendly form of \fIi_description()\fR. For others it is a human set field like \fIi_name()\fR. .Sp (\f(CW\*(C`ifAlias\*(C'\fR) .SS "Interface Statistics" .IX Subsection "Interface Statistics" .ie n .IP "$info\->\fIi_octet_in()\fR, $info\->\fIi_octets_out()\fR, $info\->\fIi_octet_in64()\fR, $info\->\fIi_octets_out64()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_octet_in()\fR, \f(CW$info\fR\->\fIi_octets_out()\fR, \f(CW$info\fR\->\fIi_octet_in64()\fR, \f(CW$info\fR\->\fIi_octets_out64()\fR" 4 .IX Item "$info->i_octet_in(), $info->i_octets_out(), $info->i_octet_in64(), $info->i_octets_out64()" Bandwidth. .Sp Number of octets sent/received on the interface including framing characters. .Sp 64 bit version may not exist on all devices. .Sp \&\s-1NOTE:\s0 To manipulate 64 bit counters you need to use Math::BigInt, since the values are too large for a normal Perl scalar. Set the global \&\f(CW$SNMP::Info::BIGINT\fR to 1 , or pass the BigInt value to \fInew()\fR if you want SNMP::Info to do it for you. .Sp (\f(CW\*(C`ifInOctets\*(C'\fR) (\f(CW\*(C`ifOutOctets\*(C'\fR) (\f(CW\*(C`ifHCInOctets\*(C'\fR) (\f(CW\*(C`ifHCOutOctets\*(C'\fR) .ie n .IP "$info\->\fIi_errors_in()\fR, $info\->\fIi_errors_out()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_errors_in()\fR, \f(CW$info\fR\->\fIi_errors_out()\fR" 4 .IX Item "$info->i_errors_in(), $info->i_errors_out()" Number of packets that contained an error preventing delivery. See \f(CW\*(C`IF\-MIB\*(C'\fR for more info. .Sp (\f(CW\*(C`ifInErrors\*(C'\fR) (\f(CW\*(C`ifOutErrors\*(C'\fR) .ie n .IP "$info\->\fIi_pkts_ucast_in()\fR, $info\->\fIi_pkts_ucast_out()\fR, $info\->\fIi_pkts_ucast_in64()\fR, $info\->\fIi_pkts_ucast_out64()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_pkts_ucast_in()\fR, \f(CW$info\fR\->\fIi_pkts_ucast_out()\fR, \f(CW$info\fR\->\fIi_pkts_ucast_in64()\fR, \f(CW$info\fR\->\fIi_pkts_ucast_out64()\fR" 4 .IX Item "$info->i_pkts_ucast_in(), $info->i_pkts_ucast_out(), $info->i_pkts_ucast_in64(), $info->i_pkts_ucast_out64()" Number of packets not sent to a multicast or broadcast address. .Sp 64 bit version may not exist on all devices. .Sp (\f(CW\*(C`ifInUcastPkts\*(C'\fR) (\f(CW\*(C`ifOutUcastPkts\*(C'\fR) (\f(CW\*(C`ifHCInUcastPkts\*(C'\fR) (\f(CW\*(C`ifHCOutUcastPkts\*(C'\fR) .ie n .IP "$info\->\fIi_pkts_nucast_in()\fR, $info\->\fIi_pkts_nucast_out()\fR," 4 .el .IP "\f(CW$info\fR\->\fIi_pkts_nucast_in()\fR, \f(CW$info\fR\->\fIi_pkts_nucast_out()\fR," 4 .IX Item "$info->i_pkts_nucast_in(), $info->i_pkts_nucast_out()," Number of packets sent to a multicast or broadcast address. .Sp These methods are deprecated by \fIi_pkts_multi_in()\fR and \fIi_pkts_bcast_in()\fR according to \f(CW\*(C`IF\-MIB\*(C'\fR. Actual device usage may vary. .Sp (\f(CW\*(C`ifInNUcastPkts\*(C'\fR) (\f(CW\*(C`ifOutNUcastPkts\*(C'\fR) .ie n .IP "$info\->\fIi_pkts_multi_in()\fR $info\->\fIi_pkts_multi_out()\fR, $info\->\fIi_pkts_multi_in64()\fR, $info\->\fIi_pkts_multi_out64()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_pkts_multi_in()\fR \f(CW$info\fR\->\fIi_pkts_multi_out()\fR, \f(CW$info\fR\->\fIi_pkts_multi_in64()\fR, \f(CW$info\fR\->\fIi_pkts_multi_out64()\fR" 4 .IX Item "$info->i_pkts_multi_in() $info->i_pkts_multi_out(), $info->i_pkts_multi_in64(), $info->i_pkts_multi_out64()" Number of packets sent to a multicast address. .Sp 64 bit version may not exist on all devices. .Sp (\f(CW\*(C`ifInMulticastPkts\*(C'\fR) (\f(CW\*(C`ifOutMulticastPkts\*(C'\fR) (\f(CW\*(C`ifHCInMulticastPkts\*(C'\fR) (\f(CW\*(C`ifHCOutMulticastPkts\*(C'\fR) .ie n .IP "$info\->\fIi_pkts_bcast_in()\fR $info\->\fIi_pkts_bcast_out()\fR, $info\->\fIi_pkts_bcast_in64()\fR $info\->\fIi_pkts_bcast_out64()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_pkts_bcast_in()\fR \f(CW$info\fR\->\fIi_pkts_bcast_out()\fR, \f(CW$info\fR\->\fIi_pkts_bcast_in64()\fR \f(CW$info\fR\->\fIi_pkts_bcast_out64()\fR" 4 .IX Item "$info->i_pkts_bcast_in() $info->i_pkts_bcast_out(), $info->i_pkts_bcast_in64() $info->i_pkts_bcast_out64()" Number of packets sent to a broadcast address on an interface. .Sp 64 bit version may not exist on all devices. .Sp (\f(CW\*(C`ifInBroadcastPkts\*(C'\fR) (\f(CW\*(C`ifOutBroadcastPkts\*(C'\fR) (\f(CW\*(C`ifHCInBroadcastPkts\*(C'\fR) (\f(CW\*(C`ifHCOutBroadcastPkts\*(C'\fR) .ie n .IP "$info\->\fIi_discards_in()\fR $info\->\fIi_discards_out()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_discards_in()\fR \f(CW$info\fR\->\fIi_discards_out()\fR" 4 .IX Item "$info->i_discards_in() $info->i_discards_out()" \&\*(L"The number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being deliverable to a higher-layer protocol. One possible reason for discarding such a packet could be to free up buffer space.\*(R" (\f(CW\*(C`IF\-MIB\*(C'\fR) .Sp (\f(CW\*(C`ifInDiscards\*(C'\fR) (\f(CW\*(C`ifOutDiscards\*(C'\fR) .ie n .IP "$info\->\fIi_bad_proto_in()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_bad_proto_in()\fR" 4 .IX Item "$info->i_bad_proto_in()" \&\*(L"For packet-oriented interfaces, the number of packets received via the interface which were discarded because of an unknown or unsupported protocol. For character-oriented or fixed-length interfaces that support protocol multiplexing the number of transmission units received via the interface which were discarded because of an unknown or unsupported protocol. For any interface that does not support protocol multiplexing, this counter will always be 0.\*(R" .Sp (\f(CW\*(C`ifInUnknownProtos\*(C'\fR) .ie n .IP "$info\->\fIi_qlen_out()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_qlen_out()\fR" 4 .IX Item "$info->i_qlen_out()" \&\*(L"The length of the output packet queue (in packets).\*(R" .Sp (\f(CW\*(C`ifOutQLen\*(C'\fR) .ie n .IP "$info\->\fIi_specific()\fR" 4 .el .IP "\f(CW$info\fR\->\fIi_specific()\fR" 4 .IX Item "$info->i_specific()" See \f(CW\*(C`IF\-MIB\*(C'\fR for full description .Sp (\f(CW\*(C`ifSpecific\*(C'\fR) .SS "\s-1IP\s0 Address Table" .IX Subsection "IP Address Table" Each entry in this table is an \s-1IP\s0 address in use on this device. Usually this is implemented in Layer3 Devices. .ie n .IP "$info\->\fIip_index()\fR" 4 .el .IP "\f(CW$info\fR\->\fIip_index()\fR" 4 .IX Item "$info->ip_index()" Maps the \s-1IP\s0 Table to the \s-1IID\s0 .Sp (\f(CW\*(C`ipAdEntIfIndex\*(C'\fR) .ie n .IP "$info\->\fIip_table()\fR" 4 .el .IP "\f(CW$info\fR\->\fIip_table()\fR" 4 .IX Item "$info->ip_table()" Maps the Table to the \s-1IP\s0 address .Sp (\f(CW\*(C`ipAdEntAddr\*(C'\fR) .ie n .IP "$info\->\fIip_netmask()\fR" 4 .el .IP "\f(CW$info\fR\->\fIip_netmask()\fR" 4 .IX Item "$info->ip_netmask()" Gives netmask setting for \s-1IP\s0 table entry. .Sp (\f(CW\*(C`ipAdEntNetMask\*(C'\fR) .ie n .IP "$info\->\fIip_broadcast()\fR" 4 .el .IP "\f(CW$info\fR\->\fIip_broadcast()\fR" 4 .IX Item "$info->ip_broadcast()" Gives broadcast address for \s-1IP\s0 table entry. .Sp (\f(CW\*(C`ipAdEntBcastAddr\*(C'\fR) .SS "\s-1IP\s0 Routing Table" .IX Subsection "IP Routing Table" .ie n .IP "$info\->\fIipr_route()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_route()\fR" 4 .IX Item "$info->ipr_route()" The route in question. A value of 0.0.0.0 is the default gateway route. .Sp (\f(CW\*(C`ipRouteDest\*(C'\fR) .ie n .IP "$info\->\fIipr_if()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_if()\fR" 4 .IX Item "$info->ipr_if()" The interface (\s-1IID\s0) that the route is on. Use \fIinterfaces()\fR to map. .Sp (\f(CW\*(C`ipRouteIfIndex\*(C'\fR) .ie n .IP "$info\->\fIipr_1()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_1()\fR" 4 .IX Item "$info->ipr_1()" Primary routing metric for this route. .Sp (\f(CW\*(C`ipRouteMetric1\*(C'\fR) .ie n .IP "$info\->\fIipr_2()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_2()\fR" 4 .IX Item "$info->ipr_2()" If metrics are not used, they should be set to \-1 .Sp (\f(CW\*(C`ipRouteMetric2\*(C'\fR) .ie n .IP "$info\->\fIipr_3()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_3()\fR" 4 .IX Item "$info->ipr_3()" (\f(CW\*(C`ipRouteMetric3\*(C'\fR) .ie n .IP "$info\->\fIipr_4()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_4()\fR" 4 .IX Item "$info->ipr_4()" (\f(CW\*(C`ipRouteMetric4\*(C'\fR) .ie n .IP "$info\->\fIipr_5()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_5()\fR" 4 .IX Item "$info->ipr_5()" (\f(CW\*(C`ipRouteMetric5\*(C'\fR) .ie n .IP "$info\->\fIipr_dest()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_dest()\fR" 4 .IX Item "$info->ipr_dest()" From \s-1RFC1213:\s0 .Sp .Vb 5 \& "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\*(Aqs IP address on that \& interface.)" .Ve .Sp (\f(CW\*(C`ipRouteNextHop\*(C'\fR) .ie n .IP "$info\->\fIipr_type()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_type()\fR" 4 .IX Item "$info->ipr_type()" From \s-1RFC1213:\s0 .Sp .Vb 6 \& 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." .Ve .Sp (\f(CW\*(C`ipRouteType\*(C'\fR) .ie n .IP "$info\->\fIipr_proto()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_proto()\fR" 4 .IX Item "$info->ipr_proto()" From \s-1RFC1213:\s0 .Sp .Vb 10 \& 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) .Ve .Sp (\f(CW\*(C`ipRouteProto\*(C'\fR) .ie n .IP "$info\->\fIipr_age()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_age()\fR" 4 .IX Item "$info->ipr_age()" Seconds since route was last updated or validated. .Sp (\f(CW\*(C`ipRouteAge\*(C'\fR) .ie n .IP "$info\->\fIipr_mask()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_mask()\fR" 4 .IX Item "$info->ipr_mask()" Subnet Mask of route. 0.0.0.0 for default gateway. .Sp (\f(CW\*(C`ipRouteMask\*(C'\fR) .ie n .IP "$info\->\fIipr_info()\fR" 4 .el .IP "\f(CW$info\fR\->\fIipr_info()\fR" 4 .IX Item "$info->ipr_info()" Reference to \s-1MIB\s0 definition specific to routing protocol. .Sp (\f(CW\*(C`ipRouteInfo\*(C'\fR) .SS "Topology Information" .IX Subsection "Topology Information" Based upon the manufacturer and software version devices may support some combination of Layer 2 topology protocol information. SNMP::Info supports querying Link Layer Discovery Protocol (\s-1LLDP\s0), Cisco Discovery Protocol (\s-1CDP\s0), SynOptics/Bay/Nortel/Avaya Network Management Protocol (\s-1SONMP\s0), Foundry/Brocade Discovery Protocol (\s-1FDP\s0), Extreme Discovery Protocol (\s-1EDP\s0), and Alcatel Mapping Adjacency Protocol (\s-1AMAP\s0). .PP For protocol specific information and implementation: .IP "\s-1LLDP:\s0 See SNMP::Info::LLDP for details." 4 .IX Item "LLDP: See SNMP::Info::LLDP for details." .PD 0 .IP "\s-1CDP:\s0 See SNMP::Info::CDP for details." 4 .IX Item "CDP: See SNMP::Info::CDP for details." .IP "\s-1SONMP:\s0 See SNMP::Info::SONMP for details." 4 .IX Item "SONMP: See SNMP::Info::SONMP for details." .IP "\s-1FDP:\s0 See SNMP::Info::FDP for details." 4 .IX Item "FDP: See SNMP::Info::FDP for details." .IP "\s-1EDP:\s0 See SNMP::Info::EDP for details." 4 .IX Item "EDP: See SNMP::Info::EDP for details." .IP "\s-1AMAP:\s0 See SNMP::Info::AMAP for details." 4 .IX Item "AMAP: See SNMP::Info::AMAP for details." .PD .PP \fITopology Capabilities\fR .IX Subsection "Topology Capabilities" .ie n .IP "$info\->\fIhas_topo()\fR" 4 .el .IP "\f(CW$info\fR\->\fIhas_topo()\fR" 4 .IX Item "$info->has_topo()" Reports Layer 2 topology protocols which are supported and running on a device. .Sp Returns either a reference to an array of protocols, possible values being: \f(CW\*(C`lldp\*(C'\fR, \f(CW\*(C`cdp\*(C'\fR, \f(CW\*(C`sonmp\*(C'\fR, \f(CW\*(C`fdp\*(C'\fR, \f(CW\*(C`edp\*(C'\fR, \f(CW\*(C`amap\*(C'\fR or \f(CW\*(C`undef\*(C'\fR if no protocols are supported or running. .PP \fICommon Topology Table Information\fR .IX Subsection "Common Topology Table Information" .PP The common topology table methods below will query the device for information from the specified topology protocols and return a single hash combining all information. As a result, there may be identical topology information returned from the two protocols causing duplicate entries. It is the calling program's responsibility to identify any duplicate entries and remove duplicates if necessary. If it is necessary to understand which protocol provided the information, utilize the protocol specific methods directly rather than the generic methods. .PP The methods support partial table fetches by providing a partial as the first argument. .PP If a reference to an array is provided as the second argument, those protocols will be queried for information. The supported array values are: \&\f(CW\*(C`lldp\*(C'\fR, \f(CW\*(C`cdp\*(C'\fR, \f(CW\*(C`sonmp\*(C'\fR, \f(CW\*(C`fdp\*(C'\fR, \f(CW\*(C`edp\*(C'\fR, \f(CW\*(C`amap\*(C'\fR. .PP If nothing is passed in as the second argument, the methods will call \&\fIhas_topo()\fR to determine supported and running topology protocols on the device. .ie n .IP "$info\->c_ip(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_ip(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_ip(partial, topology_protocol_arrayref)" Returns reference to hash. Key: iid, Value: remote IPv4 address .Sp If multiple entries exist with the same local port, \fIc_if()\fR, with the same IPv4 address, \fIc_ip()\fR, it may be a duplicate entry. .Sp If multiple entries exist with the same local port, \fIc_if()\fR, with different IPv4 addresses, \fIc_ip()\fR, there is either a device in between two or more devices utilizing a different topology protocol or multiple devices which are not directly connected. .Sp Use the protocol specific methods to dig deeper. .ie n .IP "$info\->c_if(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_if(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_if(partial, topology_protocol_arrayref)" Returns reference to hash. Key: iid, Value: local device port (interfaces) .ie n .IP "$info\->c_port(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_port(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_port(partial, topology_protocol_arrayref)" Returns reference to hash. Key: iid, Value: remote port (interfaces) .ie n .IP "$info\->c_id(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_id(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_id(partial, topology_protocol_arrayref)" Returns reference to hash. Key: iid, Value: string value used to identify the chassis component associated with the remote system. .Sp Note: \s-1SONMP\s0 does not return this information. .ie n .IP "$info\->c_platform(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_platform(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_platform(partial, topology_protocol_arrayref)" Returns reference to hash. Key: iid, Value: Remote Device Type .Sp Note: \s-1EDP\s0 does not provide this information. \s-1LLDP\s0 uses (\f(CW\*(C`lldpRemSysDesc\*(C'\fR) or \f(CW\*(C`lldp_rem_sysname\*(C'\fR as the closest match. .ie n .IP "$info\->c_cap(partial, topology_protocol_arrayref)" 4 .el .IP "\f(CW$info\fR\->c_cap(partial, topology_protocol_arrayref)" 4 .IX Item "$info->c_cap(partial, topology_protocol_arrayref)" Returns reference to hash of arrays. Key: iid, Value: Array of capabilities supported by the device. See the specific protocol class for string values which could be elements within the array. .Sp Note: Only \s-1CDP\s0 and \s-1LLDP\s0 support this method. .SH "SETTING DATA VIA SNMP" .IX Header "SETTING DATA VIA SNMP" This section explains how to use SNMP::Info to do \s-1SNMP\s0 Set operations. .ie n .IP "$info\->set_METHOD($value)" 4 .el .IP "\f(CW$info\fR\->set_METHOD($value)" 4 .IX Item "$info->set_METHOD($value)" Sets the global \s-1METHOD\s0 to value. Assumes that iid is .0 .Sp Returns if failed, or the return value from \fISNMP::Session::set()\fR (snmp_errno) .Sp .Vb 1 \& $info\->set_location("Here!"); .Ve .ie n .IP "$info\->set_METHOD($value,$iid)" 4 .el .IP "\f(CW$info\fR\->set_METHOD($value,$iid)" 4 .IX Item "$info->set_METHOD($value,$iid)" Table Methods. Set iid of method to value. .Sp Returns if failed, or the return value from \fISNMP::Session::set()\fR (snmp_errno) .Sp .Vb 4 \& # Disable a port administratively \& my %if_map = reverse %{$info\->interfaces()} \& $info\->set_i_up_admin(\*(Aqdown\*(Aq, $if_map{\*(AqFastEthernet0/0\*(Aq}) \& or die "Couldn\*(Aqt disable the port. ",$info\->error(1); .Ve .PP \&\s-1NOTE:\s0 You must be connected to your device with a \f(CW\*(C`ReadWrite\*(C'\fR community string in order for set operations to work. .PP \&\s-1NOTE:\s0 This will only set data listed in \f(CW%FUNCS\fR and \f(CW%GLOBALS\fR. For data acquired from overridden methods (subroutines) specific \fIset_METHOD()\fR subroutines will need to be added if they haven't been already. .SH "Quiet Mode" .IX Header "Quiet Mode" SNMP::Info will not chirp anything to \s-1STDOUT\s0 unless there is a serious error (in which case it will probably die). .PP To get lots of debug info, set the Debug flag when calling \fInew()\fR or call \f(CW$info\fR\->\fIdebug\fR\|(1); .PP When calling a method check the return value. If the return value is undef then check \f(CW$info\fR\->\fIerror()\fR .PP Beware, calling \f(CW$info\fR\->\fIerror()\fR clears the error. .PP .Vb 1 \& my $name = $info\->name() or die "Couldn\*(Aqt get sysName!" . $name\->error(); .Ve .SH "EXTENDING SNMP::INFO" .IX Header "EXTENDING SNMP::INFO" To support a new class (vendor or platform) of device, add a Perl package with the data structures and methods listed below. .PP If this seems a little scary, then the SNMP::Info developers are usually happy to accept the \s-1SNMP\s0 data from your device and make an attempt at the class themselves. Usually a \*(L"beta\*(R" release will go to \s-1CPAN\s0 for you to verify the implementation. .SS "Gathering \s-1MIB\s0 data for SNMP::Info Developers" .IX Subsection "Gathering MIB data for SNMP::Info Developers" The preference is to open a feature request in the SourceForge project. This allows all developers to have visibility into the request. Please include pointers to the applicable platform MIBs. For development we will need an \&\f(CW\*(C`snmpwalk\*(C'\fR of the device. There is a tool now included in the SNMP::Info distribution to help with this task, although you'll most likely need to download the distribution from \s-1CPAN\s0 as it's included in the "\f(CW\*(C`t/util\*(C'\fR" directory. .PP The utility is named \f(CW\*(C`make_snmpdata.pl\*(C'\fR. Run it with a command line like: .PP .Vb 4 \& ./make_snmpdata.pl \-c community \-i \-d device_ip \e \& \-m /home/netdisco\-mibs/rfc:/home/netdisco\-mibs/net\-snmp:/home/netdisco\-mibs/dir3 \e \& SNMPv2\-MIB IF\-MIB EtherLike\-MIB BRIDGE\-MIB Q\-BRIDGE\-MIB ENTITY\-MIB \e \& POWER\-ETHERNET\-MIB IPV6\-MIB LLDP\-MIB DEVICE\-SPECIFIC\-MIB\-NAME(s) > output.txt .Ve .PP This will print to the file every \s-1MIB\s0 entry with data in a format that the developers can use to emulate read operations without needing access to the device. Preference would be to mask any sensitive data in the output, zip the file, and upload as an attachment to the Sourceforge tracker. However, if you do not feel comfortable uploading the output to the tracker you could e\-mail it to the developer that has claimed the ticket. .SS "Data Structures required in new Subclass" .IX Subsection "Data Structures required in new Subclass" A class inheriting this class must implement these data structures : .ie n .IP "$INIT" 4 .el .IP "\f(CW$INIT\fR" 4 .IX Item "$INIT" Used to flag if the MIBs have been loaded yet. .ie n .IP "%GLOBALS" 4 .el .IP "\f(CW%GLOBALS\fR" 4 .IX Item "%GLOBALS" Contains a hash in the form ( method_name => \s-1SNMP MIB\s0 leaf name ) These are scalar values such as name, uptime, etc. .Sp To resolve \s-1MIB\s0 leaf name conflicts between private MIBs, you may prefix the leaf name with the \s-1MIB\s0 replacing each \- (dash) and : (colon) with an _ (underscore). For example, ALTEON_TIGON_SWITCH_MIB_\|_agSoftwareVersion would be used as the hash value instead of the net-snmp notation ALTEON\-TIGON\-SWITCH\-MIB::agSoftwareVersion. .Sp When choosing the name for the methods, be aware that other new Sub Modules might inherit this one to get it's features. Try to choose a prefix for methods that will give it's own name space inside the SNMP::Info methods. .ie n .IP "%FUNCS" 4 .el .IP "\f(CW%FUNCS\fR" 4 .IX Item "%FUNCS" Contains a hash in the form ( method_name => \s-1SNMP MIB\s0 leaf name) These are table entries, such as the \f(CW\*(C`ifIndex\*(C'\fR .Sp To resolve \s-1MIB\s0 leaf name conflicts between private MIBs, you may prefix the leaf name with the \s-1MIB\s0 replacing each \- (dash) and : (colon) with an _ (underscore). For example, ALTEON_TS_PHYSICAL_MIB_\|_agPortCurCfgPortName would be used as the hash value instead of the net-snmp notation ALTEON\-TS\-PHYSICAL\-MIB::agPortCurCfgPortName. .ie n .IP "%MIBS" 4 .el .IP "\f(CW%MIBS\fR" 4 .IX Item "%MIBS" A list of each mib needed. .Sp .Vb 1 \& (\*(AqMIB\-NAME\*(Aq => \*(AqitemToTestForPresence\*(Aq) .Ve .Sp The value for each entry should be a \s-1MIB\s0 object to check for to make sure that the \s-1MIB\s0 is present and has loaded correctly. .Sp \&\f(CW$info\fR\->\fIinit()\fR will throw an exception if a \s-1MIB\s0 does not load. .ie n .IP "%MUNGE" 4 .el .IP "\f(CW%MUNGE\fR" 4 .IX Item "%MUNGE" A map between method calls (from \f(CW%FUNCS\fR or \f(CW%GLOBALS\fR) and subroutine methods. The subroutine called will be passed the data as it gets it from \s-1SNMP\s0 and it should return that same data in a more human friendly format. .Sp Sample \f(CW%MUNGE:\fR .Sp .Vb 4 \& (my_ip => \e&munge_ip, \& my_mac => \e&munge_mac, \& my_layers => \e&munge_dec2bin \& ) .Ve .SS "Sample Subclass" .IX Subsection "Sample Subclass" Let's make a sample Layer 2 Device subclass. This class will inherit the Cisco Vlan module as an example. .PP \&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- snip \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .PP .Vb 1 \& # SNMP::Info::Layer2::Sample \& \& package SNMP::Info::Layer2::Sample; \& \& $VERSION = 0.1; \& \& use strict; \& \& use Exporter; \& use SNMP::Info::Layer2; \& use SNMP::Info::CiscoVTP; \& \& @SNMP::Info::Layer2::Sample::ISA = qw/SNMP::Info::Layer2 \& SNMP::Info::CiscoVTP Exporter/; \& @SNMP::Info::Layer2::Sample::EXPORT_OK = qw//; \& \& use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/; \& \& %MIBS = (%SNMP::Info::Layer2::MIBS, \& %SNMP::Info::CiscoVTP::MIBS, \& \*(AqSUPER\-DOOPER\-MIB\*(Aq => \*(Aqsupermibobject\*(Aq \& ); \& \& %GLOBALS = (%SNMP::Info::Layer2::GLOBALS, \& %SNMP::Info::CiscoVTP::GLOBALS, \& \*(Aqname\*(Aq => \*(Aqsupermib_supername\*(Aq, \& \*(Aqfavorite_color\*(Aq => \*(Aqsupermib_fav_color_object\*(Aq, \& \*(Aqfavorite_movie\*(Aq => \*(Aqsupermib_fav_movie_val\*(Aq \& ); \& \& %FUNCS = (%SNMP::Info::Layer2::FUNCS, \& %SNMP::Info::CiscoVTP::FUNCS, \& # Super Dooper MIB \- Super Hero Table \& \*(Aqsuper_hero_index\*(Aq => \*(AqSuperHeroIfIndex\*(Aq, \& \*(Aqsuper_hero_name\*(Aq => \*(AqSuperHeroIfName\*(Aq, \& \*(Aqsuper_hero_powers\*(Aq => \*(AqSuperHeroIfPowers\*(Aq \& ); \& \& \& %MUNGE = (%SNMP::Info::Layer2::MUNGE, \& %SNMP::Info::CiscoVTP::MUNGE, \& \*(Aqsuper_hero_powers\*(Aq => \e&munge_powers \& ); \& \& # OverRide uptime() method from %SNMP::Info::GLOBALS \& sub uptime { \& my $sample = shift; \& \& my $name = $sample\->name(); \& \& # this is silly but you get the idea \& return \*(Aq600\*(Aq if defined $name ; \& } \& \& # Create our own munge function \& sub munge_powers { \& my $power = shift; \& \& # Take the returned obscure value and return something useful. \& return \*(AqFire\*(Aq if $power =~ /reallyhot/i; \& return \*(AqIce\*(Aq if $power =~ /reallycold/i; \& \& # Else \& return $power; \& } \& \& # Copious Documentation here!!! \& =head1 NAME \& =head1 AUTHOR \& =head1 SYNOPSIS \& =head1 DESCRIPTION \& =head2 Inherited Classes \& =head2 Required MIBs \& =head1 GLOBALS \& =head2 Overrides \& =head1 TABLE METHODS \& =head2 Overrides \& =cut \& \& 1; # don\*(Aqt forget this line \&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- snip \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .PP Be sure and send the debugged version to snmp\-info\-users@lists.sourceforge.net to be included in the next version of SNMP::Info. .SH "SNMP::INFO INTERNALS" .IX Header "SNMP::INFO INTERNALS" .SS "Object Namespace" .IX Subsection "Object Namespace" Internal data is stored with bareword keys. For example \f(CW$info\fR\->{debug} .PP \&\s-1SNMP\s0 Data is stored or marked cached with keys starting with an underscore. For example \f(CW$info\fR\->{_name} is the cache for \f(CW$info\fR\->\fIname()\fR. .PP Cached Table data is stored in \f(CW$info\fR\->\fIstore()\fR and marked cached per above. .SS "Package Globals" .IX Subsection "Package Globals" These set the default value for an object upon creation. .ie n .IP "$DEBUG" 4 .el .IP "\f(CW$DEBUG\fR" 4 .IX Item "$DEBUG" Default 0. Sends copious debug info to stdout. This global sets the object's debug status in \fInew()\fR unless 'Debug' argument passed in \fInew()\fR. Change objects' debug status with \f(CW$info\fR\->\fIdebug()\fR. .ie n .IP "$BIGINT" 4 .el .IP "\f(CW$BIGINT\fR" 4 .IX Item "$BIGINT" Default 0. Set to true to have 64 bit counters return Math::BigInt objects instead of scalar string values. See note under Interface Statistics about 64 bit values. .ie n .IP "$NOSUCH" 4 .el .IP "\f(CW$NOSUCH\fR" 4 .IX Item "$NOSUCH" Default 1. Set to false to disable RetryNoSuch option for SNMP::Session. Or see method in \fInew()\fR to do it on an object scope. .ie n .IP "$REPEATERS" 4 .el .IP "\f(CW$REPEATERS\fR" 4 .IX Item "$REPEATERS" Default 20. MaxRepeaters for \s-1BULKWALK\s0 operations. See \f(CW\*(C`perldoc SNMP\*(C'\fR for more info. Can change by passing BulkRepeaters option in \fInew()\fR .SS "Data Munging Callback Subroutines" .IX Subsection "Data Munging Callback Subroutines" .IP "\fImunge_speed()\fR" 4 .IX Item "munge_speed()" Makes human friendly speed ratings using \f(CW%SPEED_MAP\fR .Sp .Vb 10 \& %SPEED_MAP = ( \& \*(Aq56000\*(Aq => \*(Aq56 kbps\*(Aq, \& \*(Aq64000\*(Aq => \*(Aq64 kbps\*(Aq, \& \*(Aq115000\*(Aq => \*(Aq115 kpbs\*(Aq, \& \*(Aq1500000\*(Aq => \*(Aq1.5 Mbps\*(Aq, \& \*(Aq1536000\*(Aq => \*(AqT1\*(Aq, \& \*(Aq1544000\*(Aq => \*(AqT1\*(Aq, \& \*(Aq2000000\*(Aq => \*(Aq2.0 Mbps\*(Aq, \& \*(Aq2048000\*(Aq => \*(Aq2.048 Mbps\*(Aq, \& \*(Aq3072000\*(Aq => \*(AqDual T1\*(Aq, \& \*(Aq3088000\*(Aq => \*(AqDual T1\*(Aq, \& \*(Aq4000000\*(Aq => \*(Aq4.0 Mbps\*(Aq, \& \*(Aq10000000\*(Aq => \*(Aq10 Mbps\*(Aq, \& \*(Aq11000000\*(Aq => \*(Aq11 Mbps\*(Aq, \& \*(Aq20000000\*(Aq => \*(Aq20 Mbps\*(Aq, \& \*(Aq16000000\*(Aq => \*(Aq16 Mbps\*(Aq, \& \*(Aq16777216\*(Aq => \*(Aq16 Mbps\*(Aq, \& \*(Aq44210000\*(Aq => \*(AqT3\*(Aq, \& \*(Aq44736000\*(Aq => \*(AqT3\*(Aq, \& \*(Aq45000000\*(Aq => \*(Aq45 Mbps\*(Aq, \& \*(Aq45045000\*(Aq => \*(AqDS3\*(Aq, \& \*(Aq46359642\*(Aq => \*(AqDS3\*(Aq, \& \*(Aq51850000\*(Aq => \*(AqOC\-1\*(Aq, \& \*(Aq54000000\*(Aq => \*(Aq54 Mbps\*(Aq, \& \*(Aq64000000\*(Aq => \*(Aq64 Mbps\*(Aq, \& \*(Aq100000000\*(Aq => \*(Aq100 Mbps\*(Aq, \& \*(Aq200000000\*(Aq => \*(Aq200 Mbps\*(Aq, \& \*(Aq149760000\*(Aq => \*(AqATM on OC\-3\*(Aq, \& \*(Aq155000000\*(Aq => \*(AqOC\-3\*(Aq, \& \*(Aq155519000\*(Aq => \*(AqOC\-3\*(Aq, \& \*(Aq155520000\*(Aq => \*(AqOC\-3\*(Aq, \& \*(Aq400000000\*(Aq => \*(Aq400 Mbps\*(Aq, \& \*(Aq599040000\*(Aq => \*(AqATM on OC\-12\*(Aq, \& \*(Aq622000000\*(Aq => \*(AqOC\-12\*(Aq, \& \*(Aq622080000\*(Aq => \*(AqOC\-12\*(Aq, \& \*(Aq1000000000\*(Aq => \*(Aq1.0 Gbps\*(Aq, \& \*(Aq2000000000\*(Aq => \*(Aq2.0 Gbps\*(Aq, \& \*(Aq2488000000\*(Aq => \*(AqOC\-48\*(Aq, \& ) .Ve .Sp Note: high speed interfaces (usually 1 Gbps or faster) have their link speed in \f(CW\*(C`ifHighSpeed\*(C'\fR. \fIi_speed()\fR automatically determines whether to use \&\f(CW\*(C`ifSpeed\*(C'\fR or \f(CW\*(C`ifHighSpeed\*(C'\fR; if the latter is used, the value is munged by \&\fImunge_highspeed()\fR. SNMP::Info can return speeds up to terabit levels this way. .IP "\fImunge_highspeed()\fR" 4 .IX Item "munge_highspeed()" Makes human friendly speed ratings for \f(CW\*(C`ifHighSpeed\*(C'\fR .IP "\fImunge_ip()\fR" 4 .IX Item "munge_ip()" Takes a binary \s-1IP\s0 and makes it dotted \s-1ASCII\s0 .IP "\fImunge_mac()\fR" 4 .IX Item "munge_mac()" Takes an octet stream (HEX-STRING) and returns a colon separated \s-1ASCII\s0 hex string. .IP "\fImunge_prio_mac()\fR" 4 .IX Item "munge_prio_mac()" Takes an 2\-byte octet stream (HEX-STRING) and returns a colon separated \s-1ASCII\s0 hex string. .IP "\fImunge_prio_port()\fR" 4 .IX Item "munge_prio_port()" Takes an 8\-byte octet stream (HEX-STRING) and returns a colon separated \s-1ASCII\s0 hex string. .IP "\fImunge_octet2hex()\fR" 4 .IX Item "munge_octet2hex()" Takes a binary octet stream and returns an \s-1ASCII\s0 hex string .IP "\fImunge_dec2bin()\fR" 4 .IX Item "munge_dec2bin()" Takes a binary char and returns its \s-1ASCII\s0 binary representation .IP "munge_bits" 4 .IX Item "munge_bits" Takes a \s-1SNMP2 \s0'\s-1BITS\s0' field and returns the \s-1ASCII\s0 bit string .IP "munge_counter64" 4 .IX Item "munge_counter64" If \f(CW$BIGINT\fR is set to true, then a Math::BigInt object is returned. See Math::BigInt for details. .IP "munge_i_up" 4 .IX Item "munge_i_up" Net-SNMP tends to load \f(CW\*(C`RFC1213\-MIB\*(C'\fR first, and so ignores the updated enumeration for \f(CW\*(C`ifOperStatus\*(C'\fR in \f(CW\*(C`IF\-MIB\*(C'\fR. This munge handles the \*(L"newer\*(R" definitions for the enumeration in IF-MIB. .Sp \&\s-1TODO:\s0 Get the precedence of MIBs and overriding of \s-1MIB\s0 data in Net-SNMP figured out. Heirarchy/precendence of \s-1MIBS\s0 in SNMP::Info. .IP "munge_port_list" 4 .IX Item "munge_port_list" Takes an octet string representing a set of ports and returns a reference to an array of binary values each array element representing a port. .Sp If the element has a value of '1', then that port is included in the set of ports; the port is not included if it has a value of '0'. .IP "\fImunge_null()\fR" 4 .IX Item "munge_null()" Removes control characters from a string .IP "\fImunge_e_type()\fR" 4 .IX Item "munge_e_type()" Takes an \s-1OID\s0 and return the object name if the right \s-1MIB\s0 is loaded. .SS "Internally Used Functions" .IX Subsection "Internally Used Functions" .ie n .IP "$info\->\fIinit()\fR" 4 .el .IP "\f(CW$info\fR\->\fIinit()\fR" 4 .IX Item "$info->init()" Used internally. Loads all entries in \f(CW%MIBS\fR. .ie n .IP "$info\->\fIargs()\fR" 4 .el .IP "\f(CW$info\fR\->\fIargs()\fR" 4 .IX Item "$info->args()" Returns a reference to the argument hash supplied to SNMP::Session .ie n .IP "$info\->\fIclass()\fR" 4 .el .IP "\f(CW$info\fR\->\fIclass()\fR" 4 .IX Item "$info->class()" Returns the class name of the object. .ie n .IP "$info\->error_throw(error message)" 4 .el .IP "\f(CW$info\fR\->error_throw(error message)" 4 .IX Item "$info->error_throw(error message)" Stores the error message for use by \f(CW$info\fR\->\fIerror()\fR .Sp If \f(CW$info\fR\->\fIdebug()\fR is true, then the error message is carped too. .ie n .IP "$info\->\fIfuncs()\fR" 4 .el .IP "\f(CW$info\fR\->\fIfuncs()\fR" 4 .IX Item "$info->funcs()" Returns a reference to the \f(CW%FUNCS\fR hash. .ie n .IP "$info\->\fIglobals()\fR" 4 .el .IP "\f(CW$info\fR\->\fIglobals()\fR" 4 .IX Item "$info->globals()" Returns a reference to the \f(CW%GLOBALS\fR hash. .ie n .IP "$info\->\fImibs()\fR" 4 .el .IP "\f(CW$info\fR\->\fImibs()\fR" 4 .IX Item "$info->mibs()" Returns a reference to the \f(CW%MIBS\fR hash. .ie n .IP "$info\->\fImunge()\fR" 4 .el .IP "\f(CW$info\fR\->\fImunge()\fR" 4 .IX Item "$info->munge()" Returns a reference of the \f(CW%MUNGE\fR hash. .ie n .IP "$info\->\fInosuch()\fR" 4 .el .IP "\f(CW$info\fR\->\fInosuch()\fR" 4 .IX Item "$info->nosuch()" Returns NoSuch value set or not in \fInew()\fR .ie n .IP "$info\->\fIsession()\fR" 4 .el .IP "\f(CW$info\fR\->\fIsession()\fR" 4 .IX Item "$info->session()" Gets or Sets the SNMP::Session object. .ie n .IP "$info\->store(new_store)" 4 .el .IP "\f(CW$info\fR\->store(new_store)" 4 .IX Item "$info->store(new_store)" Returns or sets hash store for Table functions. .Sp Store is a hash reference in this format : .Sp \&\f(CW$info\fR\->store = { attribute => { iid => value , iid2 => value2, ... } }; .ie n .IP "$info\->\fI_global()\fR" 4 .el .IP "\f(CW$info\fR\->\fI_global()\fR" 4 .IX Item "$info->_global()" Used internally by \s-1AUTOLOAD\s0 to create dynamic methods from \f(CW%GLOBALS\fR or a single instance \s-1MIB\s0 Leaf node name from a loaded \s-1MIB.\s0 .Sp Example: \f(CW$info\fR\->\fIname()\fR on the first call dispatches to \s-1\fIAUTOLOAD\s0()\fR which calls \f(CW$info\fR\->_global('name') creating the method \fIname()\fR. .Sp These methods return data as a scalar. .ie n .IP "$info\->_set(attr,val,iid,type)" 4 .el .IP "\f(CW$info\fR\->_set(attr,val,iid,type)" 4 .IX Item "$info->_set(attr,val,iid,type)" Used internally by \fIset_multi()\fR to run an \s-1SNMP\s0 set command. When run clears attr cache. .Sp Attr can be passed as either a scalar or a reference to an array or array of arrays when used with \fIset_multi()\fR. .Sp Example: \f(CW$info\fR\->set_name('dog',3) uses autoload to resolve to \&\f(CW$info\fR\->_set('name','dog',3); .ie n .IP "$info\->_make_setter(val,iid)" 4 .el .IP "\f(CW$info\fR\->_make_setter(val,iid)" 4 .IX Item "$info->_make_setter(val,iid)" Used internally by \s-1AUTOLOAD\s0 to create dynamic methods from either \f(CW%GLOBALS\fR, \&\f(CW%FUNCS\fR, or a valid mib leaf from a loaded \s-1MIB\s0 which runs an \s-1SNMP\s0 set command. When run clears the attribute cache. .Sp Example: \f(CW$info\fR\->set_name('dog',3) dispatches to autoload to resolve to \&\f(CW$info\fR\->_set('name','dog',3) and _make_setter creates the \fIset_name()\fR method. .ie n .IP "$info\->set_multi(arrayref)" 4 .el .IP "\f(CW$info\fR\->set_multi(arrayref)" 4 .IX Item "$info->set_multi(arrayref)" Used to run an \s-1SNMP\s0 set command on several new values in the one request. Returns the result of \f(CW$info\fR\->_set(method). .Sp Pass either a reference to a 4 element array [, , , ] or a reference to an array of 4 element arrays to specify multiple values. .Sp .Vb 7 \& \- One of the following forms: \& 1) leaf identifier (e.g., C<\*(AqsysContact\*(Aq>) \& 2) An entry in either %FUNCS, %GLOBALS (e.g., \*(Aqcontact\*(Aq) \& \- The dotted\-decimal, instance identifier. For scalar MIB objects \& use \*(Aq0\*(Aq \& \- The SNMP data value being set (e.g., \*(Aqnetdisco\*(Aq) \& \- Optional as the MIB should be loaded. .Ve .Sp If one of the set assignments is invalid, then the request will be rejected without applying any of the new values \- regardless of the order they appear in the list. .Sp Example: my \f(CW$vlan_set\fR = [ ['qb_v_untagged',\*(L"$old_vlan_id\*(R",\*(L"$old_untagged_portlist\*(R"], ['qb_v_egress',\*(L"$new_vlan_id\*(R",\*(L"$new_egress_portlist\*(R"], ['qb_v_egress',\*(L"$old_vlan_id\*(R",\*(L"$old_egress_portlist\*(R"], ['qb_v_untagged',\*(L"$new_vlan_id\*(R",\*(L"$new_untagged_portlist\*(R"], ['qb_i_vlan',\*(L"$port\*(R",\*(L"$new_vlan_id\*(R"], ]; .Sp .Vb 1 \& $info\->set_multi($vlan_set); .Ve .ie n .IP "$info\->\fIload_all()\fR" 4 .el .IP "\f(CW$info\fR\->\fIload_all()\fR" 4 .IX Item "$info->load_all()" Debugging routine. This does not include any overridden method or method implemented by subroutine. .Sp Runs \f(CW$info\fR\->\fIload_METHOD()\fR for each entry in \f(CW$info\fR\->\fIfuncs()\fR; .Sp Returns \f(CW$info\fR\->\fIstore()\fR \*(-- See \fIstore()\fR entry. .Sp Note return value has changed since version 0.3 .ie n .IP "$info\->\fIall()\fR" 4 .el .IP "\f(CW$info\fR\->\fIall()\fR" 4 .IX Item "$info->all()" Runs \f(CW$info\fR\->\fIload_all()\fR once then returns \f(CW$info\fR\->\fIstore()\fR; .Sp Use \f(CW$info\fR\->\fIload_all()\fR to reload the data. .Sp Note return value has changed since version 0.3 .ie n .IP "$info\->\fI_load_attr()\fR" 4 .el .IP "\f(CW$info\fR\->\fI_load_attr()\fR" 4 .IX Item "$info->_load_attr()" Used internally by \s-1AUTOLOAD\s0 to create dynamic methods from \f(CW%FUNCS\fR or a \s-1MIB\s0 Leaf node name contained within a table of a loaded \s-1MIB.\s0 .Sp Supports partial table fetches and single instance table fetches. See \*(L"Partial Table Fetches\*(R" in SNMP::Info. .Sp These methods return data as a reference to a hash. .ie n .IP "$info\->\fI_show_attr()\fR" 4 .el .IP "\f(CW$info\fR\->\fI_show_attr()\fR" 4 .IX Item "$info->_show_attr()" Used internally by \s-1AUTOLOAD\s0 to return data called by methods listed in \f(CW%FUNCS\fR. .ie n .IP "$info\->snmp_connect_ip(ip)" 4 .el .IP "\f(CW$info\fR\->snmp_connect_ip(ip)" 4 .IX Item "$info->snmp_connect_ip(ip)" Returns true or false based upon snmp connectivity to an \s-1IP.\s0 .IP "modify_port_list(portlist,offset,replacement)" 4 .IX Item "modify_port_list(portlist,offset,replacement)" Replaces the specified bit in a port_list array and returns the packed bitmask .ie n .IP "$info\->_cache(attr, data)" 4 .el .IP "\f(CW$info\fR\->_cache(attr, data)" 4 .IX Item "$info->_cache(attr, data)" Cache retrieved data so that if it's asked for again, we use the cache instead of going back to Net-SNMP. Data is cached inside the blessed hashref \f(CW$self\fR. .Sp Accepts the leaf and value (scalar, or hashref for a table). Does not return anything useful. .ie n .IP "$info\->_munge(attr, data)" 4 .el .IP "\f(CW$info\fR\->_munge(attr, data)" 4 .IX Item "$info->_munge(attr, data)" Raw data returned from Net-SNMP might not be formatted correctly or might have platform-specific bugs or mistakes. The \s-1MUNGE\s0 feature of SNMP::Info allows for fixups to take place. .Sp Accepts the leaf and value (scalar, or hashref for a table) and returns the raw or the munged data, as appropriate. That is, you do not need to know whether \&\s-1MUNGE\s0 is installed, and it's safe to call this method regardless. .IP "_validate_autoload_method(method)" 4 .IX Item "_validate_autoload_method(method)" Used internally by \s-1AUTOLOAD\s0 to validate that a dynamic method should be created. Returns the \s-1OID\s0 of the \s-1MIB\s0 leaf node the method will get or set. .RS 4 .ie n .IP "1. Returns unless method is listed in %FUNCS, %GLOBALS, or is \s-1MIB\s0 Leaf node name in a loaded \s-1MIB\s0 for given class." 4 .el .IP "1. Returns unless method is listed in \f(CW%FUNCS\fR, \f(CW%GLOBALS\fR, or is \s-1MIB\s0 Leaf node name in a loaded \s-1MIB\s0 for given class." 4 .IX Item "1. Returns unless method is listed in %FUNCS, %GLOBALS, or is MIB Leaf node name in a loaded MIB for given class." .PD 0 .IP "2. Translates the \s-1MIB\s0 Leaf node name to an \s-1OID.\s0" 4 .IX Item "2. Translates the MIB Leaf node name to an OID." .IP "3. Checks to see if the method access type is allowed for the resolved \s-1OID. \s0 Write access for set_ methods, read access for others." 4 .IX Item "3. Checks to see if the method access type is allowed for the resolved OID. Write access for set_ methods, read access for others." .RE .RS 4 .RE .ie n .IP "$info\->\fIcan()\fR" 4 .el .IP "\f(CW$info\fR\->\fIcan()\fR" 4 .IX Item "$info->can()" .PD Overrides \fIUNIVERSAL::can()\fR so that objects will correctly report their capabilities to include dynamic methods generated at run time via \s-1AUTOLOAD.\s0 .Sp Calls parent \fIcan()\fR first to see if method exists, if not validates that a method should be created then dispatches to the appropriate internal method for creation. The newly created method is inserted into the symbol table returning to \s-1AUTOLOAD\s0 only for the initial method call. .Sp Returns undef if the method does not exist and can not be created. .SS "\s-1AUTOLOAD\s0" .IX Subsection "AUTOLOAD" Each entry in either \f(CW%FUNCS\fR, \f(CW%GLOBALS\fR, or \s-1MIB\s0 Leaf node names present in loaded MIBs are used by \s-1\fIAUTOLOAD\s0()\fR to create dynamic methods. Generated methods are inserted into the symbol table so that subsequent calls can avoid \&\s-1\fIAUTOLOAD\s0()\fR and dispatch directly. .ie n .IP "1. Returns unless method is listed in %FUNCS, %GLOBALS, or is a \s-1MIB\s0 Leaf node name in a loaded \s-1MIB\s0 for given class." 4 .el .IP "1. Returns unless method is listed in \f(CW%FUNCS\fR, \f(CW%GLOBALS\fR, or is a \s-1MIB\s0 Leaf node name in a loaded \s-1MIB\s0 for given class." 4 .IX Item "1. Returns unless method is listed in %FUNCS, %GLOBALS, or is a MIB Leaf node name in a loaded MIB for given class." .PD 0 .ie n .IP "2. If the method exists in %GLOBALS or is a single instance \s-1MIB\s0 Leaf node name from a loaded \s-1MIB,\s0 \fI_global()\fR generates the method." 4 .el .IP "2. If the method exists in \f(CW%GLOBALS\fR or is a single instance \s-1MIB\s0 Leaf node name from a loaded \s-1MIB,\s0 \fI_global()\fR generates the method." 4 .IX Item "2. If the method exists in %GLOBALS or is a single instance MIB Leaf node name from a loaded MIB, _global() generates the method." .IP "3. If a set_ prefix is present \fI_make_setter()\fR generates the method." 4 .IX Item "3. If a set_ prefix is present _make_setter() generates the method." .ie n .IP "4. If the method exists in %FUNCS or is a \s-1MIB\s0 Leaf node name contained within a table from a loaded \s-1MIB,\s0 \fI_load_attr()\fR generates the method." 4 .el .IP "4. If the method exists in \f(CW%FUNCS\fR or is a \s-1MIB\s0 Leaf node name contained within a table from a loaded \s-1MIB,\s0 \fI_load_attr()\fR generates the method." 4 .IX Item "4. If the method exists in %FUNCS or is a MIB Leaf node name contained within a table from a loaded MIB, _load_attr() generates the method." .IP "5. A load_ prefix forces reloading of data and does not use cached data." 4 .IX Item "5. A load_ prefix forces reloading of data and does not use cached data." .IP "6. A _raw suffix returns data ignoring any munge routines." 4 .IX Item "6. A _raw suffix returns data ignoring any munge routines." .PD .PP Override any dynamic method listed in \f(CW%GLOBALS\fR, \f(CW%FUNCS\fR, or \s-1MIB\s0 Leaf node name a by creating a subroutine with the same name. .PP For example to override \f(CW$info\fR\->\fIname()\fR create `` sub name {...}'' in your subclass. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Changes from SNMP::Info Version 0.7 and on are: Copyright (c) 2003\-2010 Max Baker and SNMP::Info Developers All rights reserved. .PP Original Code is: Copyright (c) 2002\-2003, Regents of the University of California All rights reserved. .PP Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: .PP .Vb 8 \& * Redistributions of source code must retain the above copyright notice, \& this list of conditions and the following disclaimer. \& * 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. \& * Neither the name of the University of California, Santa Cruz nor the \& names of its contributors may be used to endorse or promote products \& derived from this software without specific prior written permission. .Ve .PP \&\s-1THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \*(L"AS IS\*(R" 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 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \s0(\s-1INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES\s0; \s-1LOSS OF USE, DATA, OR PROFITS\s0; \s-1OR BUSINESS INTERRUPTION\s0) \s-1HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \s0(\s-1INCLUDING NEGLIGENCE OR OTHERWISE\s0) \s-1ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\s0