diff --git a/network/f5/bigip/mode/components/fan.pm b/network/f5/bigip/mode/components/fan.pm index c5aa6acb8..262aae7f3 100644 --- a/network/f5/bigip/mode/components/fan.pm +++ b/network/f5/bigip/mode/components/fan.pm @@ -47,7 +47,7 @@ my %map_status = ( sub check { my ($self) = @_; - $self->{components}->{fan} = {name => 'fans', total => 0}; + $self->{components}->{fan} = {name => 'fans', total => 0, skip => 0}; $self->{output}->output_add(long_msg => "Checking fans"); return if ($self->check_exclude(section => 'fan')); diff --git a/network/f5/bigip/mode/components/psu.pm b/network/f5/bigip/mode/components/psu.pm index b85b420de..89eb0d6a2 100644 --- a/network/f5/bigip/mode/components/psu.pm +++ b/network/f5/bigip/mode/components/psu.pm @@ -47,7 +47,7 @@ my %map_status = ( sub check { my ($self) = @_; - $self->{components}->{psu} = {name => 'psus', total => 0}; + $self->{components}->{psu} = {name => 'psus', total => 0, skip => 0}; $self->{output}->output_add(long_msg => "Checking power supplies"); return if ($self->check_exclude(section => 'psu')); diff --git a/network/f5/bigip/mode/components/temperature.pm b/network/f5/bigip/mode/components/temperature.pm index 83bfac94a..6b9400cd4 100644 --- a/network/f5/bigip/mode/components/temperature.pm +++ b/network/f5/bigip/mode/components/temperature.pm @@ -42,7 +42,7 @@ sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "Checking temperatures"); - $self->{components}->{temperature} = {name => 'temperatures', total => 0}; + $self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0}; return if ($self->check_exclude(section => 'temperature')); my $oid_sysChassisTempEntry = '.1.3.6.1.4.1.3375.2.1.3.2.3.2.1'; @@ -59,7 +59,7 @@ sub check { my $exit_code = $self->{perfdata}->threshold_check(value => $result->{$oid_sysChassisTempTemperature . '.' . $instance}, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); - $self->{components}->{temperatures}->{total}++; + $self->{components}->{temperature}->{total}++; $self->{output}->output_add(severity => $exit_code,long_msg => sprintf("temp_" . $instance . " is %.2f C", $result->{$oid_sysChassisTempTemperature . '.' . $instance})); if (!$self->{output}->is_status(value => $exit_code, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit_code,short_msg => sprintf("temp_" . $instance . " is %.2f C", $result->{$oid_sysChassisTempTemperature . '.' . $instance})); diff --git a/network/f5/bigip/mode/hardware.pm b/network/f5/bigip/mode/hardware.pm index 879ecd548..0dcf649a9 100644 --- a/network/f5/bigip/mode/hardware.pm +++ b/network/f5/bigip/mode/hardware.pm @@ -101,15 +101,14 @@ sub run { $self->{output}->option_exit(); } - my $total_components = 0; my $display_by_component = ''; my $display_by_component_append = ''; foreach my $comp (sort(keys %{$self->{components}})) { # Skipping short msg when no components - next if ($self->{components}->{$comp}->{total} == 0); - $total_components += $self->{components}->{$comp}->{total}; - $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . ' ' . $self->{components}->{$comp}->{name}; + next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0); + $total_components += $self->{components}->{$comp}->{total} + $self->{components}->{$comp}->{skip}; + $display_by_component .= $display_by_component_append . $self->{components}->{$comp}->{total} . '/' . $self->{components}->{$comp}->{skip} . ' ' . $self->{components}->{$comp}->{name}; $display_by_component_append = ', '; }