-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: More Cisco devices support enhancement
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package GLPI::Agent::SNMP::MibSupport::Cisco; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use parent 'GLPI::Agent::SNMP::MibSupportTemplate'; | ||
|
||
use GLPI::Agent::Tools; | ||
use GLPI::Agent::Tools::SNMP; | ||
|
||
use constant priority => 5; | ||
|
||
# See ENTITY-MIB | ||
use constant entPhysicalModelName => '.1.3.6.1.2.1.47.1.1.1.1.13'; | ||
|
||
# See CISCO-SMI | ||
use constant cisco => '.1.3.6.1.4.1.9'; | ||
use constant cisco_local => cisco . '.2'; | ||
|
||
# See OLD-CISCO-MEMORY-MIB | ||
use constant hostName => cisco_local . '.1.3.0' ; | ||
|
||
our $mibSupport = [ | ||
{ | ||
name => "cisco", | ||
sysobjectid => getRegexpOidMatch(cisco) | ||
} | ||
]; | ||
|
||
sub getModel { | ||
my ($self) = @_; | ||
|
||
my $device = $self->device | ||
or return; | ||
|
||
return getCanonicalString($device->{snmp}->get_first(entPhysicalModelName)); | ||
} | ||
|
||
sub getSnmpHostname { | ||
my ($self) = @_; | ||
|
||
return getCanonicalString($self->get(hostName)); | ||
} | ||
|
||
1; | ||
|
||
__END__ | ||
=head1 NAME | ||
GLPI::Agent::SNMP::MibSupport::Cisco - Inventory module to enhance Cisco devices support. | ||
=head1 DESCRIPTION | ||
The module enhances Cisco support. |