Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hwg.pm, add support for ste2 device #921

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions lib/FusionInventory/Agent/SNMP/MibSupport/Hwg.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package FusionInventory::Agent::SNMP::MibSupport::Hwg;

use strict;
use warnings;

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

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::SNMP;

# See Hwg-MIB

use constant hwg => '.1.3.6.1.4.1.21796';
use constant hwgModel => '.1.3.6.1.2.1.1.1.0';
use constant hwgWldMac => hwg . '.4.5.70.1.0';
use constant hwgSteMac => hwg . '.4.1.70.1.0';
use constant hwgSte2Mac => hwg . '.4.9.70.1.0';

our $mibSupport = [
{
name => "hwg",
sysobjectid => getRegexpOidMatch(hwg)
}
];

sub getType {
return 'NETWORKING';
}

sub getManufacturer {
return 'HW group s.r.o';
}

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

my $serial = getCanonicalMacAddress(getCanonicalString($self->get(hwgWldMac) || $self->get(hwgSteMac) || $self->get(hwgSte2Mac)));
$serial =~ s/://g;

return $serial;
}

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

return getCanonicalMacAddress(getCanonicalString($self->get(hwgWldMac) || $self->get(hwgSteMac) || $self->get(hwgSte2Mac)));
}

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

return $self->get(hwgModel);
}

1;

__END__

=head1 NAME

FusionInventory::Agent::SNMP::MibSupport::Hwg - Inventory module for Hwg

=head1 DESCRIPTION

This module enhances Hwg devices support.