Fix #2062
This commit is contained in:
parent
9134c388ba
commit
770cbccf4d
|
@ -84,6 +84,7 @@ sub new {
|
||||||
'no-component:s' => { name => 'no_component' },
|
'no-component:s' => { name => 'no_component' },
|
||||||
'threshold-overload:s@' => { name => 'threshold_overload' },
|
'threshold-overload:s@' => { name => 'threshold_overload' },
|
||||||
'add-name-instance' => { name => 'add_name_instance' },
|
'add-name-instance' => { name => 'add_name_instance' },
|
||||||
|
'no-component-count' => { name => 'no_component_count' }
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{performance} = (defined($options{no_performance}) && $options{no_performance} == 1) ?
|
$self->{performance} = (defined($options{no_performance}) && $options{no_performance} == 1) ?
|
||||||
|
@ -120,8 +121,7 @@ sub new {
|
||||||
$self->{components_exec_load} = 1;
|
$self->{components_exec_load} = 1;
|
||||||
$self->set_system();
|
$self->set_system();
|
||||||
|
|
||||||
$self->{count} = (defined($options{no_count}) && $options{no_count} == 1) ?
|
$self->{count} = (defined($options{no_count}) && $options{no_count} == 1) ? 0 : 1;
|
||||||
0 : 1;
|
|
||||||
if ($self->{count} == 1) {
|
if ($self->{count} == 1) {
|
||||||
foreach my $component (@{$self->{components_module}}) {
|
foreach my $component (@{$self->{components_module}}) {
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
|
@ -290,7 +290,7 @@ sub display {
|
||||||
|
|
||||||
foreach my $comp (sort(keys %{$self->{components}})) {
|
foreach my $comp (sort(keys %{$self->{components}})) {
|
||||||
# Skipping short msg when no 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) {
|
if ($self->{count} == 1) {
|
||||||
($exit, $warn, $crit) = $self->get_severity_count(label => $comp, value => $self->{components}->{$comp}->{total});
|
($exit, $warn, $crit) = $self->get_severity_count(label => $comp, value => $self->{components}->{$comp}->{total});
|
||||||
|
|
Loading…
Reference in New Issue