Small fixes. OIDs moved to MIBs

This commit is contained in:
Andrey Pazychev
2020-05-09 05:03:55 +03:00
parent f96d0df182
commit fc71e2d88d
2 changed files with 18 additions and 36 deletions

View File

@@ -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, );

View File

@@ -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()