From fc71e2d88d5a0f7c17b3963b127337bcd2eb8e13 Mon Sep 17 00:00:00 2001 From: Andrey Pazychev Date: Sat, 9 May 2020 05:03:55 +0300 Subject: [PATCH] Small fixes. OIDs moved to MIBs --- lib/SNMP/Info/Layer2/Carelink.pm | 8 +++--- lib/SNMP/Info/Layer3/Qtech.pm | 46 ++++++++++---------------------- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/lib/SNMP/Info/Layer2/Carelink.pm b/lib/SNMP/Info/Layer2/Carelink.pm index a2f6b7d2..a1199d54 100755 --- a/lib/SNMP/Info/Layer2/Carelink.pm +++ b/lib/SNMP/Info/Layer2/Carelink.pm @@ -27,10 +27,10 @@ our $index = undef; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - 'serial_oid' => '.1.3.6.1.2.1.47.1.1.1.1.11.1', - 'os_ver_oid' => '.1.3.6.1.2.1.47.1.1.1.1.9.1', - 'hw_oid' => '.1.3.6.1.2.1.47.1.1.1.1.2.1', - 'fw_mac_oid' => '.1.3.6.1.2.1.47.1.1.1.1.11.1', + 'serial_oid' => 'mib-2.47.1.1.1.1.11.1', + 'os_ver_oid' => 'mib-2.47.1.1.1.1.9.1', + 'hw_oid' => 'mib-2.47.1.1.1.1.2.1', + 'fw_mac_oid' => 'mib-2.47.1.1.1.1.11.1', ); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, ); diff --git a/lib/SNMP/Info/Layer3/Qtech.pm b/lib/SNMP/Info/Layer3/Qtech.pm index 47f7f278..d5b5b35c 100644 --- a/lib/SNMP/Info/Layer3/Qtech.pm +++ b/lib/SNMP/Info/Layer3/Qtech.pm @@ -8,7 +8,6 @@ package SNMP::Info::Layer3::Qtech; use strict; use warnings; use Exporter; -use SNMP::Info::Layer2; use SNMP::Info::Layer3; @SNMP::Info::Layer3::Qtech::ISA = qw/SNMP::Info::Layer3 Exporter/; @@ -18,44 +17,27 @@ our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); $VERSION = '3.70-135'; -%MIBS = ( - %SNMP::Info::Layer2::MIBS, - %SNMP::Info::Layer3::MIBS, -); +%MIBS = ( %SNMP::Info::Layer3::MIBS, ); %GLOBALS = ( - %SNMP::Info::Layer2::GLOBALS, %SNMP::Info::Layer3::GLOBALS, - 'hostname' => '.1.3.6.1.2.1.47.1.1.1.1.7.1', - 'model_oid' => '.1.3.6.1.2.1.47.1.1.1.1.13.1', - 'hw_oid' => '.1.3.6.1.2.1.47.1.1.1.1.8.1', - 'serial_oid' => '.1.3.6.1.2.1.47.1.1.1.1.11.1', - 'bootrom_oid' => '.1.3.6.1.2.1.47.1.1.1.1.9.1', - 'os_ver_oid' => '.1.3.6.1.2.1.47.1.1.1.1.10.1', + 'hostname' => 'mib-2.47.1.1.1.1.7.1', + 'model_oid' => 'mib-2.47.1.1.1.1.13.1', + 'hw_oid' => 'mib-2.47.1.1.1.1.8.1', + 'serial_oid' => 'mib-2.47.1.1.1.1.11.1', + 'bootrom_oid' => 'mib-2.47.1.1.1.1.9.1', + 'os_ver_oid' => 'mib-2.47.1.1.1.1.10.1', ); -%FUNCS = ( - %SNMP::Info::Layer2::FUNCS, - %SNMP::Info::Layer3::FUNCS, -); +%FUNCS = ( %SNMP::Info::Layer3::FUNCS, ); -%MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::Layer3::MUNGE, ); +%MUNGE = ( %SNMP::Info::Layer3::MUNGE, ); sub model { my $qtech = shift; my $model = $qtech->model_oid; my $hw = $qtech->hw_oid; - return $model . ' HW:(' . $hw . ')'; -} - -# ifDescr is the same for all interfaces in a class, but the ifName is -# unique, so let's use that for port name. -sub interfaces { - my $qtech = shift; - my $partial = shift; - - my $interfaces = $qtech->orig_i_name($partial); - return $interfaces; + return $model . ' HW:' . $hw; } sub vendor { @@ -68,13 +50,13 @@ sub os { sub os_ver { my $qtech = shift; - my $os_ver = $qtech->os_ver_oid(); - return $os_ver . ' Bootrom: ' . $qtech->bootrom_oid; + my $os_ver = $qtech->os_ver_oid; + return $os_ver . ' bootrom: ' . $qtech->bootrom_oid; } sub serial { my $qtech = shift; - my $serial = $qtech->serial_oid(); + my $serial = $qtech->serial_oid; return $serial; } @@ -128,7 +110,7 @@ Returns the ID or else description. =item $qtech->vendor() -Returns 'dlink'. +Returns 'qtech'. =item $qtech->serial()