134 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			134 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
| # SNMP::Info::Layer2::Carelink - SNMP Interface to Carelink Devices
 | |
| #
 | |
| # Copyright (c) 2020 by 135.
 | |
| 
 | |
| package SNMP::Info::Layer2::Carelink;
 | |
| 
 | |
| use strict;
 | |
| use warnings;
 | |
| use Exporter;
 | |
| use SNMP::Info::Layer2;
 | |
| use SNMP::Info::Layer3;
 | |
| 
 | |
| @SNMP::Info::Layer2::Carelink::ISA       = qw/SNMP::Info::Layer2 Exporter/;
 | |
| @SNMP::Info::Layer2::Carelink::EXPORT_OK = qw//;
 | |
| 
 | |
| our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);
 | |
| 
 | |
| $VERSION = '3.70-135';
 | |
| 
 | |
| # This will be filled in with the device's index into the EntPhysicalEntry
 | |
| # table by the serial() function.
 | |
| our $index = undef;
 | |
| 
 | |
| %MIBS = (
 | |
|     %SNMP::Info::Layer2::MIBS,
 | |
| );
 | |
| 
 | |
| %GLOBALS = (
 | |
|     %SNMP::Info::Layer2::GLOBALS,
 | |
|     '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, );
 | |
| 
 | |
| %MUNGE = ( %SNMP::Info::Layer2::MUNGE, );
 | |
| 
 | |
| sub vendor {
 | |
|     return 'carelink';
 | |
| }
 | |
| sub os {
 | |
|     return 'caos';
 | |
| }
 | |
| 
 | |
| sub os_ver {
 | |
|     my $carelink = shift;
 | |
|     my $ver = $carelink->os_ver_oid() || undef;
 | |
|     return $ver if (defined $ver);
 | |
|     return 'Unknown';
 | |
| }
 | |
| sub model {
 | |
|     my $carelink = shift;
 | |
|     my $id = $carelink->id();
 | |
|     my $mod = $carelink->hw_oid() || undef;
 | |
|     return $mod if (defined $mod);
 | |
|     return 'Unknown';
 | |
| }
 | |
| 
 | |
| 1;
 | |
| __END__
 | |
| 
 | |
| =head1 NAME
 | |
| 
 | |
| SNMP::Info::Layer2::Carelink - SNMP Interface to Carelink Devices
 | |
| 
 | |
| =head1 SYNOPSIS
 | |
| 
 | |
|  # Let SNMP::Info determine the correct subclass for you.
 | |
|  my $carelink = new SNMP::Info(
 | |
|                           AutoSpecify => 1,
 | |
|                           Debug       => 1,
 | |
|                           DestHost    => 'myrouter',
 | |
|                           Community   => 'public',
 | |
|                           Version     => 2
 | |
|                         )
 | |
|     or die "Can't connect to DestHost.\n";
 | |
| 
 | |
|  my $class      = $carelink->class();
 | |
|  print "SNMP::Info determined this device to fall under subclass : $class\n";
 | |
| 
 | |
| =head1 DESCRIPTION
 | |
| 
 | |
| Subclass for carelink Devices running IOS-like software
 | |
| 
 | |
| =head2 Inherited Classes
 | |
| 
 | |
| =over
 | |
| 
 | |
| =item SNMP::Info::Layer2
 | |
| 
 | |
| =item SNMP::Info::Layer3
 | |
| 
 | |
| =back
 | |
| 
 | |
| =head2 Inherited Classes' MIBs
 | |
| 
 | |
| See L<SNMP::Info::Layer2/"Required MIBs"> for its own MIB requirements.
 | |
| 
 | |
| 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 $carelink->vendor()
 | |
| 
 | |
| Returns 'adtran'
 | |
| 
 | |
| =item $carelink->os()
 | |
| 
 | |
| Returns 'caos'
 | |
| 
 | |
| =item $carelink->layers()
 | |
| 
 | |
| Ensures that layer two is reported, at least.
 | |
| 
 | |
| =item $carelink->os_ver()
 | |
| 
 | |
| Returns the software version.
 | |
| 
 | |
| =item $carelink->model()
 | |
| 
 | |
| Returns the model extracted.
 | |
| 
 | |
| =item $carelink->serial()
 | |
| 
 | |
| Returns serial number.
 | |
| 
 | |
| =cut
 |