Skip to content

Commit e6abe3b

Browse files
committed
fix: Add FoxGate devices support
1 parent e5fb02d commit e6abe3b

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ netdiscovery/netinventory:
4040
* fix #900: Add Veritas NetBackup linux Appliance support
4141
* fix #995: Update Sindoh printers support
4242
* fix #959: Add Avocent KVM support
43+
* Add FoxGate devices support
4344

4445
injector:
4546
* Add support for --ca-cert-file and --ssl-fingerprint options
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package GLPI::Agent::SNMP::MibSupport::FoxGate;
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+
use constant sysDescr => '.1.3.6.1.2.1.1.1.0';
12+
13+
# FoxGate-MIB
14+
use constant FoxGate => ".1.3.6.1.4.1.6339" ;
15+
16+
use constant os => FoxGate . ".100";
17+
18+
use constant sysHardwareVersion => os . ".1.2.0";
19+
use constant sysSoftwareVersion => os . ".1.3.0";
20+
21+
use constant ntpEntSoftwareName => os . ".25.1.1.1.0";
22+
23+
our $mibSupport = [
24+
{
25+
name => "foxgate",
26+
sysobjectid => getRegexpOidMatch(FoxGate)
27+
}
28+
];
29+
30+
sub getFirmware {
31+
my ($self) = @_;
32+
33+
return getCanonicalString($self->get(sysSoftwareVersion));
34+
}
35+
36+
sub getModel {
37+
my ($self) = @_;
38+
39+
my $model = getCanonicalString($self->get(ntpEntSoftwareName));
40+
if (empty($model)) {
41+
my $sysDescr = getCanonicalString($self->get(sysDescr));
42+
my ($device) = split("\n", $sysDescr);
43+
($model) = $device =~ /^(\S+) Device,/
44+
if $device;
45+
}
46+
return $model;
47+
}
48+
49+
sub getManufacturer {
50+
return "FoxGate";
51+
}
52+
53+
sub getSerial {
54+
my ($self) = @_;
55+
56+
my $serial;
57+
58+
my $sysDescr = getCanonicalString($self->get(sysDescr));
59+
my @lines = split("\n", $sysDescr);
60+
my $serialline = first { /^\s*Device serial number/ } @lines;
61+
($serial) = $serialline =~ /^\s*Device serial number\s+(\S+)$/
62+
if $serialline;
63+
return $serial;
64+
}
65+
66+
sub run {
67+
my ($self) = @_;
68+
69+
my $device = $self->device
70+
or return;
71+
72+
my $sysDescr = getCanonicalString($self->get(sysDescr));
73+
my @lines = split("\n", $sysDescr);
74+
my $model = $self->getModel();
75+
76+
my $bootrom = first { /^\s*BootRom Version/ } @lines;
77+
if ($bootrom) {
78+
my ($version) = $bootrom =~ /^\s*BootRom Version\s+(\S+)$/;
79+
my $bootromFirmware = {
80+
NAME => "$model bootrom",
81+
DESCRIPTION => "bootrom version",
82+
TYPE => "device",
83+
VERSION => $version,
84+
MANUFACTURER => "FoxGate"
85+
};
86+
$device->addFirmware($bootromFirmware);
87+
}
88+
89+
my $hardware = first { /^\s*HardWare Version/ } @lines;
90+
if ($hardware) {
91+
my ($version) = $hardware =~ /^\s*HardWare Version\s+(\S+)$/;
92+
my $bootromFirmware = {
93+
NAME => "$model hardware",
94+
DESCRIPTION => "hardware version",
95+
TYPE => "device",
96+
VERSION => $version,
97+
MANUFACTURER => "FoxGate"
98+
};
99+
$device->addFirmware($bootromFirmware);
100+
}
101+
}
102+
103+
1;
104+
105+
__END__
106+
107+
=head1 NAME
108+
109+
GLPI::Agent::SNMP::MibSupport::Htek - Inventory module for FoxGate devices
110+
111+
=head1 DESCRIPTION
112+
113+
The module enhances support for FoxGate devices

0 commit comments

Comments
 (0)