diff --git a/Changes b/Changes index d8190fda..e28e73a8 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Version 3.55 [NEW FEATURES] + * #258 Add support for Arbor devices (robwwd) * #253 Nexans switch support (paecker) * #142 Sixnet Switch Support diff --git a/MANIFEST b/MANIFEST index 1f64a8f1..a98e171d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -257,6 +257,7 @@ xt/lib/Test/SNMP/Info/Layer3/VMware.pm xt/lib/Test/SNMP/Info/Layer3/VyOS.pm xt/lib/Test/SNMP/Info/Layer7.pm xt/lib/Test/SNMP/Info/Layer7/APC.pm +xt/lib/Test/SNMP/Info/Layer7/Arbor.pm xt/lib/Test/SNMP/Info/Layer7/CiscoIPS.pm xt/lib/Test/SNMP/Info/Layer7/Gigamon.pm xt/lib/Test/SNMP/Info/Layer7/Neoteris.pm diff --git a/META.json b/META.json index 8958cb4e..e95744b2 100644 --- a/META.json +++ b/META.json @@ -255,10 +255,18 @@ "file" : "lib/SNMP/Info/Layer2/Netgear.pm", "version" : "3.54" }, + "SNMP::Info::Layer2::Nexans" : { + "file" : "lib/SNMP/Info/Layer2/Nexans.pm", + "version" : "3.54" + }, "SNMP::Info::Layer2::Orinoco" : { "file" : "lib/SNMP/Info/Layer2/Orinoco.pm", "version" : "3.54" }, + "SNMP::Info::Layer2::Sixnet" : { + "file" : "lib/SNMP/Info/Layer2/Sixnet.pm", + "version" : "3.54" + }, "SNMP::Info::Layer2::Trapeze" : { "file" : "lib/SNMP/Info/Layer2/Trapeze.pm", "version" : "3.54" diff --git a/META.yml b/META.yml index 373f3588..1d544516 100644 --- a/META.yml +++ b/META.yml @@ -178,9 +178,15 @@ provides: SNMP::Info::Layer2::Netgear: file: lib/SNMP/Info/Layer2/Netgear.pm version: '3.54' + SNMP::Info::Layer2::Nexans: + file: lib/SNMP/Info/Layer2/Nexans.pm + version: '3.54' SNMP::Info::Layer2::Orinoco: file: lib/SNMP/Info/Layer2/Orinoco.pm version: '3.54' + SNMP::Info::Layer2::Sixnet: + file: lib/SNMP/Info/Layer2/Sixnet.pm + version: '3.54' SNMP::Info::Layer2::Trapeze: file: lib/SNMP/Info/Layer2/Trapeze.pm version: '3.54' diff --git a/README b/README index 6a9ccf67..dd6bc140 100644 --- a/README +++ b/README @@ -23,14 +23,14 @@ DEVICES SUPPORTED SYNOPSIS use SNMP::Info; - my $info = new 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 => 'router', Community => 'public', - Version => 2 + Version => 2 ) or die "Can't connect to device.\n"; my $err = $info->error(); @@ -61,7 +61,7 @@ SYNOPSIS # 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_map = reverse %$c_if; my $c_key = $c_map{$iid}; unless (defined $c_key) { print "\n\n"; @@ -515,6 +515,11 @@ SUBCLASSES See documentation in SNMP::Info::Layer2::Netgear for details. + SNMP::Info::Layer2::Nexans + Subclass for Nexans switches + + See documetion in SNMP::Info::Layer2::Nexans for details. + SNMP::Info::Layer2::NWSS2300 SNMP Interface to Avaya (Trapeze) Wireless Controllers @@ -530,6 +535,11 @@ SUBCLASSES See documentation in SNMP::Info::Layer2::Trapeze for details. + SNMP::Info::Layer2::Sixnet + SNMP Interface to Sixnet industrial switches + + See documentation in SNMP::Info::Layer2::Sixnet for details. + SNMP::Info::Layer2::Ubiquiti SNMP Interface to Ubiquiti Access Points and other devices @@ -650,9 +660,9 @@ SUBCLASSES See documentation in SNMP::Info::Layer3::DLink for details. SNMP::Info::Layer3::Dell - Subclass for Dell PowerConnect switches. D-Link, the IBM - BladeCenter Gigabit Ethernet Switch Module and some Linksys - switches also use this module based upon MIB support. + Subclass for Dell PowerConnect switches. The IBM BladeCenter + Gigabit Ethernet Switch Module and some Linksys switches also + use this module based upon MIB support. See documentation in SNMP::Info::Layer3::Dell for details. @@ -820,6 +830,11 @@ SUBCLASSES See documentation in SNMP::Info::Layer7::APC for details. + SNMP::Info::Layer7::Arbor + Subclass for Arbor appliances + + See documentation in SNMP::Info::Layer7::Arbor for details. + SNMP::Info::Layer7::CiscoIPS Subclass for Cisco IPS devices @@ -1121,7 +1136,7 @@ USAGE This returns a binary encoded string where each digit represents a layer of the OSI model served by the device. - eg: 01000010 means layers 2 (physical) and 7 (Application) + eg: 01000010 means layers 2 (physical) and 7 (Application) are served. Note: This string is 8 digits long. @@ -1602,7 +1617,7 @@ SETTING DATA VIA SNMP # Disable a port administratively my %if_map = reverse %{$info->interfaces()} - $info->set_i_up_admin('down', $if_map{'FastEthernet0/0'}) + $info->set_i_up_admin('down', $if_map{'FastEthernet0/0'}) or die "Couldn't disable the port. ",$info->error(1); NOTE: You must be connected to your device with a "ReadWrite" community @@ -1784,7 +1799,7 @@ EXTENDING SNMP::INFO return 'Fire' if $power =~ /reallyhot/i; return 'Ice' if $power =~ /reallycold/i; - # Else + # Else return $power; } @@ -1848,12 +1863,12 @@ SNMP::INFO INTERNALS '64000' => '64 kbps', '115000' => '115 kpbs', '1500000' => '1.5 Mbps', - '1536000' => 'T1', + '1536000' => 'T1', '1544000' => 'T1', '2000000' => '2.0 Mbps', '2048000' => '2.048 Mbps', '3072000' => 'Dual T1', - '3088000' => 'Dual T1', + '3088000' => 'Dual T1', '4000000' => '4.0 Mbps', '10000000' => '10 Mbps', '11000000' => '11 Mbps', @@ -1875,7 +1890,7 @@ SNMP::INFO INTERNALS '155519000' => 'OC-3', '155520000' => 'OC-3', '400000000' => '400 Mbps', - '599040000' => 'ATM on OC-12', + '599040000' => 'ATM on OC-12', '622000000' => 'OC-12', '622080000' => 'OC-12', '1000000000' => '1.0 Gbps', @@ -2157,8 +2172,8 @@ COPYRIGHT AND LICENSE * 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 + * 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS diff --git a/lib/SNMP/Info.pm b/lib/SNMP/Info.pm index f9e29c92..35a48ef7 100644 --- a/lib/SNMP/Info.pm +++ b/lib/SNMP/Info.pm @@ -995,10 +995,16 @@ See documentation in L for details. =item SNMP::Info::Layer7::APC -Subclass for APC UPS devices +Subclass for APC UPS devices See documentation in L for details. +=item SNMP::Info::Layer7::Arbor + +Subclass for Arbor appliances + +See documentation in L for details. + =item SNMP::Info::Layer7::CiscoIPS Subclass for Cisco IPS devices diff --git a/lib/SNMP/Info/Layer7/Arbor.pm b/lib/SNMP/Info/Layer7/Arbor.pm index d6a32317..78e9cdec 100644 --- a/lib/SNMP/Info/Layer7/Arbor.pm +++ b/lib/SNMP/Info/Layer7/Arbor.pm @@ -97,6 +97,7 @@ sub os_ver { 1; + __END__ =head1 NAME @@ -181,10 +182,6 @@ See documentation in L for details. These are methods that return tables of information in the form of a reference to a hash. -=over - -=back - =head2 Table Methods imported from SNMP::Info::Layer7 See documentation in L for details. diff --git a/xt/lib/Test/SNMP/Info/Layer7/Arbor.pm b/xt/lib/Test/SNMP/Info/Layer7/Arbor.pm new file mode 100644 index 00000000..4a403056 --- /dev/null +++ b/xt/lib/Test/SNMP/Info/Layer7/Arbor.pm @@ -0,0 +1,95 @@ +# Test::SNMP::Info::Layer7::Arbor +# +# Copyright (c) 2018 Rob Woodward +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * 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. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +package Test::SNMP::Info::Layer7::Arbor; + +use Test::Class::Most parent => 'My::Test::Class'; + +use SNMP::Info::Layer7::Arbor; + +sub setup : Tests(setup) { + my $test = shift; + $test->SUPER::setup; + + # Start with a common cache that will serve most tests + my $cache_data = { + '_layers' => 72, + '_description' => 'Peakflow TMS 8.2 Model: TMS-2800-40G Serial: CT24227201ZQ', + '_id' => '.1.3.6.1.4.1.9694.1.4', + 'store' => {}, + }; + $test->{info}->cache($cache_data); +} + +sub os : Tests(2) { + my $test = shift; + + can_ok($test->{info}, 'os'); + is($test->{info}->os(), 'ArbOS', q(OS returns 'ArbOS')); +} + +sub os_ver : Tests(3) { + my $test = shift; + + can_ok($test->{info}, 'os_ver'); + is($test->{info}->os_ver(), '8.2', q(OS version has expected value)); + + $test->{info}->clear_cache(); + is($test->{info}->os_ver(), undef, + q(No description returns undef OS version)); +} + +sub serial : Tests(3) { + my $test = shift; + + can_ok($test->{info}, 'serial'); + is($test->{info}->serial(), 'CT24227201ZQ', q(Serial has expected value)); + + $test->{info}->clear_cache(); + is($test->{info}->serial(), undef, q(No data returns undef serial)); +} + +sub vendor : Tests(2) { + my $test = shift; + + can_ok($test->{info}, 'vendor'); + is($test->{info}->vendor(), 'arbor', q(Vendor returns 'arbor')); +} + +sub model : Tests(3) { + my $test = shift; + + can_ok($test->{info}, 'model'); + is($test->{info}->model(), 'TMS-2800-40G', q(Model has expected value)); + + $test->{info}->clear_cache(); + is($test->{info}->model(), undef, q(No description returns undef model)); +} + +1; \ No newline at end of file