From 128e81734f2df8eae1cccf7007edfbbf6808b63a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 18 Jun 2019 16:23:11 +0200 Subject: [PATCH] add option counter for config --- centreon/plugins/templates/counter.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/centreon/plugins/templates/counter.pm b/centreon/plugins/templates/counter.pm index d6bbd2113..49d861fc6 100644 --- a/centreon/plugins/templates/counter.pm +++ b/centreon/plugins/templates/counter.pm @@ -174,13 +174,18 @@ sub check_options { $self->SUPER::init(%options); if (defined($self->{option_results}->{list_counters})) { - my $list_counter = "Counter list:"; + my $list_counter = 'counter list:'; + my $th_counter = ''; foreach my $key (keys %{$self->{maps_counters}}) { foreach (@{$self->{maps_counters}->{$key}}) { + my $label = $_->{label}; + $label =~ s/-//g; $list_counter .= " " . $_->{label}; + $th_counter .= " --warning-$label='\$_SERVICEWARNING" . uc($label) . "\$' --critical-$label='\$_SERVICECRITICAL" . uc($label) . "\$'"; } } $self->{output}->output_add(short_msg => $list_counter); + $self->{output}->output_add(long_msg => 'configuration: ' . $th_counter); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1); $self->{output}->exit(); }