Skip to content

Commit 1f3a116

Browse files
committed
fix: Update fortinet devices support dedicated module
1 parent ccbf107 commit 1f3a116

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/GLPI/Agent/SNMP/MibSupport/Fortinet.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ sub getComponents {
4242
# Replace components with found HA devices
4343
my $index = $self->walk(fgHaStatsIndex);
4444
if (ref($index) eq "HASH") {
45-
delete $device->{COMPONENTS};
4645
my @index = sort values(%{$index});
4746
foreach my $index (@index) {
48-
my $serial = getCanonicalString($self->get(fgHaStatsSerial.".".$index));
47+
my $serial = getCanonicalString($self->get(fgHaStatsSerial.".".$index))
48+
or next;
4949
push @components, {
5050
INDEX => $index,
5151
NAME => getCanonicalString($self->get(fgHaStatsHostname.".".$index)),
@@ -55,6 +55,8 @@ sub getComponents {
5555
TYPE => 'chassis',
5656
};
5757
}
58+
return unless @components;
59+
delete $device->{COMPONENTS};
5860
}
5961
}
6062

0 commit comments

Comments
 (0)