|
| 1 | +package GLPI::Agent::SNMP::MibSupport::Avocent; |
| 2 | + |
| 3 | +use strict; |
| 4 | +use warnings; |
| 5 | + |
| 6 | +use parent 'GLPI::Agent::SNMP::MibSupportTemplate'; |
| 7 | + |
| 8 | +use GLPI::Agent::Tools; |
| 9 | +use GLPI::Agent::Tools::SNMP; |
| 10 | + |
| 11 | +# ACS8000-MIB |
| 12 | +use constant avocent => ".1.3.6.1.4.1.10418" ; |
| 13 | + |
| 14 | +use constant acsAppliance => avocent . ".26.2.1"; |
| 15 | + |
| 16 | +use constant acsHostName => acsAppliance . ".1.0"; |
| 17 | +use constant acsProductModel => acsAppliance . ".2.0"; |
| 18 | +use constant acsSerialNumber => acsAppliance . ".4.0"; |
| 19 | +use constant acsBootcodeVersion => acsAppliance . ".6.0"; |
| 20 | +use constant acsFirmwareVersion => acsAppliance . ".7.0"; |
| 21 | + |
| 22 | +our $mibSupport = [ |
| 23 | + { |
| 24 | + name => "avocent", |
| 25 | + sysobjectid => getRegexpOidMatch(avocent) |
| 26 | + } |
| 27 | +]; |
| 28 | + |
| 29 | +sub getFirmware { |
| 30 | + my ($self) = @_; |
| 31 | + |
| 32 | + return getCanonicalString($self->get(acsFirmwareVersion)); |
| 33 | +} |
| 34 | + |
| 35 | +sub getModel { |
| 36 | + my ($self) = @_; |
| 37 | + |
| 38 | + return getCanonicalString($self->get(acsProductModel)); |
| 39 | +} |
| 40 | + |
| 41 | +sub getSnmpHostname { |
| 42 | + my ($self) = @_; |
| 43 | + |
| 44 | + return getCanonicalString($self->get(acsHostName)); |
| 45 | +} |
| 46 | + |
| 47 | +sub getSerial { |
| 48 | + my ($self) = @_; |
| 49 | + |
| 50 | + return getCanonicalString($self->get(acsSerialNumber)); |
| 51 | +} |
| 52 | + |
| 53 | +sub run { |
| 54 | + my ($self) = @_; |
| 55 | + |
| 56 | + my $device = $self->device |
| 57 | + or return; |
| 58 | + |
| 59 | + # Handle bootcode version if found |
| 60 | + my $bootcodeVersion = getCanonicalString($self->get(acsBootcodeVersion)); |
| 61 | + unless (empty($bootcodeVersion)) { |
| 62 | + my $model = $device->{MODEL} ? $device->{MODEL}." " : ""; |
| 63 | + my $bootcodeFirmware = { |
| 64 | + NAME => $model."bootcode", |
| 65 | + DESCRIPTION => "bootcode firmware version", |
| 66 | + TYPE => "device", |
| 67 | + VERSION => $bootcodeVersion, |
| 68 | + MANUFACTURER => "Avocent" |
| 69 | + }; |
| 70 | + |
| 71 | + $device->addFirmware($bootcodeFirmware); |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | +1; |
| 76 | + |
| 77 | +__END__ |
| 78 | +
|
| 79 | +=head1 NAME |
| 80 | +
|
| 81 | +GLPI::Agent::SNMP::MibSupport::Avocent - Inventory module for Avocent devices |
| 82 | +
|
| 83 | +=head1 DESCRIPTION |
| 84 | +
|
| 85 | +The module enhances support for Avocent devices |
0 commit comments