Skip to content

Commit 2106670

Browse files
committed
fix: Add Intelbras devices support for netdiscovery & netinventory
Closes #769
1 parent 8b670e3 commit 2106670

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Revision history for GLPI agent
44

55
netdiscovery/netinventory:
66
* fix #768: Added Aerohive devices support
7+
* fix #769: Added Intelbras devices support
78

89
1.11 Tue, 24 Sep 2024
910

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
package GLPI::Agent::SNMP::MibSupport::Intelbras;
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+
# See DAHUA-SNMP-MIB
12+
use constant dahua => '.1.3.6.1.4.1.1004849';
13+
14+
use constant systemInfo => dahua . '.2.1';
15+
16+
use constant softwareRevision => systemInfo . '.1.1.0';
17+
use constant hardwareRevision => systemInfo . '.1.2.0';
18+
use constant serialNumber => systemInfo . '.2.4.0';
19+
use constant systemVersion => systemInfo . '.2.5.0';
20+
use constant deviceType => systemInfo . '.2.6.0';
21+
22+
our $mibSupport = [
23+
{
24+
name => "intelbras",
25+
oid => systemInfo
26+
}
27+
];
28+
29+
sub getType {
30+
return 'NETWORKING';
31+
}
32+
33+
sub getManufacturer {
34+
my ($self) = @_;
35+
36+
return 'Intelbras';
37+
}
38+
39+
sub getSerial {
40+
my ($self) = @_;
41+
42+
return getCanonicalString($self->get(serialNumber));
43+
}
44+
45+
sub getFirmware {
46+
my ($self) = @_;
47+
48+
return getCanonicalString($self->get(softwareRevision));
49+
}
50+
51+
sub getModel {
52+
my ($self) = @_;
53+
54+
return getCanonicalString($self->get(deviceType));
55+
}
56+
57+
sub run {
58+
my ($self) = @_;
59+
60+
my $device = $self->device
61+
or return;
62+
63+
my $hardwareRevision = getCanonicalString($self->get(hardwareRevision));
64+
if ($hardwareRevision) {
65+
my $firmware = {
66+
NAME => "Intelbras hardware",
67+
DESCRIPTION => "Hardware version",
68+
TYPE => "hardware",
69+
VERSION => $hardwareRevision,
70+
MANUFACTURER => "Intelbras"
71+
};
72+
$device->addFirmware($firmware);
73+
}
74+
75+
my $systemVersion = getCanonicalString($self->get(systemVersion));
76+
if ($systemVersion) {
77+
my $firmware = {
78+
NAME => "Intelbras system",
79+
DESCRIPTION => "System version",
80+
TYPE => "system",
81+
VERSION => $systemVersion,
82+
MANUFACTURER => "Intelbras"
83+
};
84+
$device->addFirmware($firmware);
85+
}
86+
}
87+
88+
1;
89+
90+
__END__
91+
92+
=head1 NAME
93+
94+
GLPI::Agent::SNMP::MibSupport::Intelbras - Inventory module for Intelbras
95+
96+
=head1 DESCRIPTION
97+
98+
This module enhances Intelbras products support.

0 commit comments

Comments
 (0)