This commit is contained in:
garnier-quentin 2020-06-23 10:53:05 +02:00
parent e50fed6524
commit cf99974b33
1 changed files with 12 additions and 12 deletions

View File

@ -84,6 +84,7 @@ sub new {
'no-component:s' => { name => 'no_component' },
'threshold-overload:s@' => { name => 'threshold_overload' },
'add-name-instance' => { name => 'add_name_instance' },
'no-component-count' => { name => 'no_component_count' }
});
$self->{performance} = (defined($options{no_performance}) && $options{no_performance} == 1) ?
@ -120,8 +121,7 @@ sub new {
$self->{components_exec_load} = 1;
$self->set_system();
$self->{count} = (defined($options{no_count}) && $options{no_count} == 1) ?
0 : 1;
$self->{count} = (defined($options{no_count}) && $options{no_count} == 1) ? 0 : 1;
if ($self->{count} == 1) {
foreach my $component (@{$self->{components_module}}) {
$options{options}->add_options(arguments => {
@ -290,7 +290,7 @@ sub display {
foreach my $comp (sort(keys %{$self->{components}})) {
# Skipping short msg when no components
next if ($self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0);
next if (!defined($self->{option_results}->{no_component_count}) && $self->{components}->{$comp}->{total} == 0 && $self->{components}->{$comp}->{skip} == 0);
if ($self->{count} == 1) {
($exit, $warn, $crit) = $self->get_severity_count(label => $comp, value => $self->{components}->{$comp}->{total});