From 8ab187a57380243c673301f20f63f7eab1117282 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 17 Jun 2020 14:16:57 +0200 Subject: [PATCH] fix cluster status --- .../common/fortinet/fortigate/snmp/mode/clusterstatus.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm b/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm index 7f7cd9c2a..f78205ef4 100644 --- a/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm +++ b/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm @@ -123,13 +123,13 @@ sub set_counters { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $options{options}->add_options(arguments => { 'warning-status:s' => { name => 'warning_status', default => '' }, 'critical-status:s' => { name => 'critical_status', default => '%{role} ne %{roleLast} or %{sync_status} =~ /not synchronized/' }, - 'one-node-status:s' => { name => 'one_node_status' }, # not used, use --opt-exit instead + 'one-node-status:s' => { name => 'one_node_status' } # not used, use --opt-exit instead }); return $self; @@ -207,6 +207,9 @@ sub manage_selection { $self->{output}->add_option_msg(short_msg => 'No cluster nodes found'); $self->{output}->option_exit(); } + + $self->{cache_name} = 'fortinet_fortigate_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); } 1;