mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
fix fortigate cluster status ha roles
This commit is contained in:
parent
99dcf514cd
commit
636c7a74ce
@ -145,17 +145,19 @@ sub manage_selection {
|
|||||||
$self->{nodes} = {};
|
$self->{nodes} = {};
|
||||||
|
|
||||||
my $mode = $self->{snmp}->get_leef(oids => [ $oid_fgHaSystemMode ], nothing_quit => 1);
|
my $mode = $self->{snmp}->get_leef(oids => [ $oid_fgHaSystemMode ], nothing_quit => 1);
|
||||||
|
|
||||||
if ($map_ha_mode{$mode->{$oid_fgHaSystemMode}} =~ /standalone/) {
|
if ($map_ha_mode{$mode->{$oid_fgHaSystemMode}} =~ /standalone/) {
|
||||||
$self->{output}->add_option_msg(short_msg => "No cluster configuration (standalone mode)");
|
$self->{output}->add_option_msg(short_msg => "No cluster configuration (standalone mode)");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{output}->output_add(short_msg => "HA mode: " . $map_ha_mode{$mode->{$oid_fgHaSystemMode}});
|
||||||
|
|
||||||
$self->{results} = $options{snmp}->get_table(oid => $oid_fgHaStatsEntry,
|
$self->{results} = $options{snmp}->get_table(oid => $oid_fgHaStatsEntry,
|
||||||
nothing_quit => 1);
|
nothing_quit => 1);
|
||||||
|
|
||||||
foreach my $oid (keys %{$self->{results}}) {
|
foreach my $oid (keys %{$self->{results}}) {
|
||||||
next if($oid !~ /^$mapping->{fgHaStatsSerial}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping->{fgHaStatsSerial}->{oid}\.(.*)$/);
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
|
|
||||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance);
|
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance);
|
||||||
@ -164,7 +166,7 @@ sub manage_selection {
|
|||||||
serial => $result->{fgHaStatsSerial},
|
serial => $result->{fgHaStatsSerial},
|
||||||
hostname => $result->{fgHaStatsHostname},
|
hostname => $result->{fgHaStatsHostname},
|
||||||
sync_status => $result->{fgHaStatsSyncStatus},
|
sync_status => $result->{fgHaStatsSyncStatus},
|
||||||
role => ($result->{fgHaStatsMasterSerial} eq '') ? "master" : "slave",
|
role => ($result->{fgHaStatsMasterSerial} eq '' || $result->{fgHaStatsMasterSerial} =~ /$result->{fgHaStatsSerial}/) ? "master" : "slave",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user