<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package GLPI::Agent::SNMP::MibSupport::UPS;

use strict;
use warnings;

use parent 'GLPI::Agent::SNMP::MibSupportTemplate';

use GLPI::Agent::Tools;
use GLPI::Agent::Tools::SNMP;

use constant    apc =&gt; '.1.3.6.1.4.1.318' ;
use constant    riello =&gt; '.1.3.6.1.4.1.5491' ;

# See PowerNet-MIB

use constant    upsAdvIdentSerialNumber =&gt; apc . '.1.1.1.1.2.3.0';
use constant    sPDUIdentFirmwareRev    =&gt; apc . '.1.1.4.1.2.0';
use constant    sPDUIdentModelNumber    =&gt; apc . '.1.1.4.1.4.0';
use constant    sPDUIdentSerialNumber   =&gt; apc . '.1.1.4.1.5.0';

# See UPS-MIB

use constant    upsMIB  =&gt; '.1.3.6.1.2.1.33' ;
use constant    upsIdentManufacturer        =&gt; upsMIB  .'.1.1.1.0' ;
use constant    upsIdentModel               =&gt; upsMIB  .'.1.1.2.0' ;
use constant    upsIdentUPSSoftwareVersion  =&gt; upsMIB  .'.1.1.3.0' ;

my $match = apc.'|'.upsMIB.'|'.riello;

our $mibSupport = [
    {
        name        =&gt; "apc",
        sysobjectid =&gt; qr/^$match/
    }
];

sub getModel {
    my ($self) = @_;

    return $self-&gt;get(upsIdentModel) || $self-&gt;get(sPDUIdentModelNumber);
}

sub getSerial {
    my ($self) = @_;

    return $self-&gt;get(upsAdvIdentSerialNumber) || $self-&gt;get(sPDUIdentSerialNumber);
}

sub getFirmware {
    my ($self) = @_;

    return $self-&gt;get(upsIdentUPSSoftwareVersion) || $self-&gt;get(sPDUIdentFirmwareRev);
}

sub getManufacturer {
    my ($self) = @_;

    return getCanonicalString($self-&gt;get(upsIdentManufacturer));
}

sub getType {
    # TODO remove when POWER is supported on server-side and replace by 'POWER'
    return 'NETWORKING';
}

1;

__END__

=head1 NAME

GLPI::Agent::SNMP::MibSupport::UPS - Inventory module for APC modules

=head1 DESCRIPTION

The module enhances APC devices support.
</pre></body></html>