133 lines
2.5 KiB
Perl
Executable File
133 lines
2.5 KiB
Perl
Executable File
# SNMP::Info::Layer3::Deliberant - SNMP Interface to Deliberant Devices
|
|
#
|
|
# Copyright (c) 2020 by 135.
|
|
|
|
package SNMP::Info::Layer3::Deliberant;
|
|
|
|
use strict;
|
|
use warnings;
|
|
use Exporter;
|
|
use SNMP::Info::Layer3;
|
|
|
|
@SNMP::Info::Layer3::Deliberant::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
|
@SNMP::Info::Layer3::Deliberant::EXPORT_OK = qw//;
|
|
|
|
our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);
|
|
|
|
$VERSION = '3.70-135';
|
|
|
|
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
|
|
|
%GLOBALS = (
|
|
%SNMP::Info::Layer3::GLOBALS,
|
|
'model_oid' => 'enterprises.32761.3.1.1.1.3.0',
|
|
'submodel' => 'enterprises.32761.3.1.1.1.2.0',
|
|
);
|
|
|
|
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
|
|
|
|
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
|
|
|
sub vendor {
|
|
return 'deliberant';
|
|
}
|
|
|
|
sub os {
|
|
return 'deliberant-os';
|
|
}
|
|
|
|
sub os_ver {
|
|
my $obj = shift;
|
|
my $os_ver;
|
|
my $os_ver_oid = $obj->description;
|
|
$os_ver_oid =~ /\,\s(.*)/;
|
|
$os_ver = $1;
|
|
|
|
if (defined $os_ver) {
|
|
return $os_ver;
|
|
}
|
|
return 'unknown';
|
|
}
|
|
sub model {
|
|
my $obj = shift;
|
|
my $id = $obj->id();
|
|
my $model = $obj->model_oid || undef;
|
|
my $submodel = $obj->submodel || undef;
|
|
$model .= ' (' . $obj->submodel . ')' if defined($submodel);
|
|
|
|
return $model if defined $model;
|
|
return $obj->SUPER::model();
|
|
}
|
|
|
|
sub serial {
|
|
my $obj = shift;
|
|
return $obj->SUPER::serial();
|
|
}
|
|
|
|
1;
|
|
__END__
|
|
|
|
=head1 NAME
|
|
|
|
SNMP::Info::Layer3::Deliberant - SNMP Interface to Deliberant Devices
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
# Let SNMP::Info determine the correct subclass for you.
|
|
my $obj = new SNMP::Info(
|
|
AutoSpecify => 1,
|
|
Debug => 1,
|
|
DestHost => 'myrouter',
|
|
Community => 'public',
|
|
Version => 2
|
|
)
|
|
or die "Can't connect to DestHost.\n";
|
|
|
|
my $class = $obj->class();
|
|
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
Subclass for Deliberant Devices
|
|
|
|
=head2 Inherited Classes
|
|
|
|
=over
|
|
|
|
=item SNMP::Info::Layer3
|
|
|
|
=back
|
|
|
|
=head2 Inherited Classes' MIBs
|
|
|
|
See L<SNMP::Info::Layer3/"Required MIBs"> for its own MIB requirements.
|
|
|
|
=head1 GLOBALS
|
|
|
|
These are methods that return scalar value from SNMP
|
|
|
|
=over
|
|
|
|
=item $obj->vendor()
|
|
|
|
Returns 'deliberant-oem'
|
|
|
|
=item $obj->os()
|
|
|
|
Returns 'rotek-os'
|
|
|
|
=item $obj->os_ver()
|
|
|
|
Returns the software version.
|
|
|
|
=item $obj->model()
|
|
|
|
Returns the model extracted.
|
|
|
|
=item $obj->serial()
|
|
|
|
Returns serial number.
|
|
|
|
=cut
|
|
|
|
=back |