mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
style(plugin): adjust indentation - CTOR-586 (#5033)
This commit is contained in:
parent
53fc5ca260
commit
ebbf35b945
@ -44,10 +44,10 @@ sub new {
|
||||
if (!defined($options{noptions})) {
|
||||
$options{options}->add_options(arguments => {
|
||||
'hostname:s' => { name => 'hostname' },
|
||||
'port:s' => { name => 'port'},
|
||||
'port:s' => { name => 'port' },
|
||||
'proto:s' => { name => 'proto' },
|
||||
'api-password:s' => { name => 'api_password' },
|
||||
'timeout:s' => { name => 'timeout', default => 30 },
|
||||
'timeout:s' => { name => 'timeout'},
|
||||
'unknown-http-status:s' => { name => 'unknown_http_status' },
|
||||
'warning-http-status:s' => { name => 'warning_http_status' },
|
||||
'critical-http-status:s' => { name => 'critical_http_status' }
|
||||
@ -228,7 +228,7 @@ sub api_fields {
|
||||
);
|
||||
|
||||
# Fields may be messed-up with wrongly encoded characters, let's force some cleanup
|
||||
for (my $i = 0; $i < scalar(@{$status->{ $options{field} }}); $i++) {
|
||||
for (my $i = 0 ; $i < scalar(@{$status->{ $options{field} }}) ; $i++) {
|
||||
$status->{ $options{field} }->[$i]->{term} =~ s/[\r\n]//g;
|
||||
$status->{ $options{field} }->[$i]->{term} =~ s/^\s+|\s+$//g;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ sub set_counters {
|
||||
|
||||
$self->{maps_counters}->{global} = [
|
||||
{ label => 'events', nlabel => 'events.count', set => {
|
||||
key_values => [ { name => 'events' } ],
|
||||
key_values => [{ name => 'events' }],
|
||||
output_template => 'Matching events: %s',
|
||||
perfdatas => [
|
||||
{ template => '%s', value => 'events', min => 0 }
|
||||
@ -99,11 +99,11 @@ Count events matching the query.
|
||||
|
||||
=item B<--time-period>
|
||||
|
||||
Set request period, in minutes.
|
||||
Set request period, in minutes (mandatory option).
|
||||
|
||||
=item B<--query>
|
||||
|
||||
Set the query.
|
||||
Set the query (mandatory option).
|
||||
|
||||
=item B<--output-field>
|
||||
|
||||
|
@ -35,7 +35,7 @@ sub set_counters {
|
||||
|
||||
$self->{maps_counters}->{global} = [
|
||||
{ label => 'events', nlabel => 'events.count', display_ok => 1, set => {
|
||||
key_values => [ { name => 'events' } ],
|
||||
key_values => [{ name => 'events' }],
|
||||
output_template => 'Matching events: %s',
|
||||
perfdatas => [
|
||||
{ template => '%s', min => 0 }
|
||||
@ -43,7 +43,7 @@ sub set_counters {
|
||||
}
|
||||
},
|
||||
{ label => 'fields', nlabel => 'fields.count', display_ok => 1, set => {
|
||||
key_values => [ { name => 'fields' } ],
|
||||
key_values => [{ name => 'fields' }],
|
||||
output_template => 'Matching fields: %s',
|
||||
perfdatas => [
|
||||
{ template => '%s', min => 0 }
|
||||
@ -54,7 +54,7 @@ sub set_counters {
|
||||
|
||||
$self->{maps_counters}->{field} = [
|
||||
{ label => 'field-events', nlabel => 'field.events.count', set => {
|
||||
key_values => [ { name => 'count' }, { name => 'display' } ],
|
||||
key_values => [{ name => 'count' }, { name => 'display' }],
|
||||
output_template => 'matching events: %s',
|
||||
perfdatas => [
|
||||
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
@ -128,7 +128,7 @@ sub manage_selection {
|
||||
foreach (@{$results->{$self->{option_results}->{field}}}) {
|
||||
if (!defined($self->{option_results}->{filter_field}) || ($_->{term} =~ /$self->{option_results}->{filter_field}/i)) {
|
||||
$fields++;
|
||||
$events += $_->{count};
|
||||
$events+= $_->{count};
|
||||
$self->{field}->{$fields} = {
|
||||
display => $_->{term},
|
||||
count => $_->{count}
|
||||
@ -151,19 +151,19 @@ Count unique field-values from events matching the query.
|
||||
|
||||
=item B<--time-period>
|
||||
|
||||
Set request period, in minutes.
|
||||
Set request period, in minutes (mandatory option).
|
||||
|
||||
=item B<--query>
|
||||
|
||||
Set the query.
|
||||
Set the query (mandatory option).
|
||||
|
||||
=item B<--field>
|
||||
|
||||
Set the field to count unique values for (example: json.host).
|
||||
Set the field to count unique values for example: json.host (mandatory option).
|
||||
|
||||
=item B<--filter-field>
|
||||
|
||||
Set the a field filter.
|
||||
Define which fields should be counted. This option will be treated as a regular expression. If this option is empty, all fields will be counted.
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
--add-sysdesc
|
||||
--api-password
|
||||
--display-transform-dst
|
||||
--display-transform-src
|
||||
--exclude-fs
|
||||
@ -33,6 +34,7 @@ interface-dsl-name
|
||||
IpAddr
|
||||
Iwsva
|
||||
license-instances-usage-prct
|
||||
Loggly
|
||||
MBean
|
||||
NagVis
|
||||
Netscaler
|
||||
|
Loading…
x
Reference in New Issue
Block a user