+ Fix indentation

This commit is contained in:
garnier-quentin 2015-10-22 11:42:57 +02:00
parent bc437ff10a
commit 5e198d22ee

View File

@ -118,17 +118,17 @@ my $maps_counters = {
}, },
}, },
sum => { sum => {
'000_sum-read-write' => { set => { '000_sum-read-write' => { set => {
key_values => [ { name => 'sum_read_write', diff => 1 } ], key_values => [ { name => 'sum_read_write', diff => 1 } ],
per_second => 1, per_second => 1,
output_template => 'R+W I/O : %s %s/s', output_error_template => "R+W I/O : %s", output_template => 'R+W I/O : %s %s/s', output_error_template => "R+W I/O : %s",
output_change_bytes => 1, output_change_bytes => 1,
perfdatas => [ perfdatas => [
{ label => 'sum_read_write', value => 'sum_read_write_per_second', template => '%d', { label => 'sum_read_write', value => 'sum_read_write_per_second', template => '%d',
unit => 'B/s', min => 0 }, unit => 'B/s', min => 0 },
], ],
} }
}, },
'001_sum-read-write-iops' => { set => { '001_sum-read-write-iops' => { set => {
key_values => [ { name => 'sum_read_write_iops', diff => 1 } ], key_values => [ { name => 'sum_read_write_iops', diff => 1 } ],
per_second => 1, per_second => 1,
@ -215,7 +215,7 @@ sub check_total {
next; next;
} }
my $exit2 = $obj->threshold_check(); my $exit2 = $obj->threshold_check();
push @exits, $exit2; push @exits, $exit2;
my $output = $obj->output(); my $output = $obj->output();
$long_msg .= $long_msg_append . $output; $long_msg .= $long_msg_append . $output;
@ -230,7 +230,6 @@ sub check_total {
} }
my $exit = $self->{output}->get_most_critical(status => [ @exits ]); my $exit = $self->{output}->get_most_critical(status => [ @exits ]);
if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => "All devices [$short_msg]" short_msg => "All devices [$short_msg]"
@ -262,9 +261,8 @@ sub check_sum {
my $output = $obj->output(); my $output = $obj->output();
$long_msg .= $long_msg_append . $output; $long_msg .= $long_msg_append . $output;
$long_msg_append = ', '; $long_msg_append = ', ';
if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) { if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) {
$short_msg .= $short_msg_append . $output; $short_msg .= $short_msg_append . $output;
$short_msg_append = ', '; $short_msg_append = ', ';
@ -274,7 +272,6 @@ sub check_sum {
} }
my $exit = $self->{output}->get_most_critical(status => [ @exits ]); my $exit = $self->{output}->get_most_critical(status => [ @exits ]);
if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) { if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => "Server overall [$short_msg]" short_msg => "Server overall [$short_msg]"
@ -286,7 +283,6 @@ sub check_sum {
sub run { sub run {
my ($self, %options) = @_; my ($self, %options) = @_;
# $options{snmp} = snmp object
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{hostname} = $self->{snmp}->get_hostname(); $self->{hostname} = $self->{snmp}->get_hostname();
$self->{snmp_port} = $self->{snmp}->get_port(); $self->{snmp_port} = $self->{snmp}->get_port();
@ -309,7 +305,7 @@ sub run {
if ($multiple == 1) { if ($multiple == 1) {
$self->check_total(); $self->check_total();
$self->check_sum(); $self->check_sum();
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(severity => 'OK',
short_msg => 'All devices are ok.'); short_msg => 'All devices are ok.');
} }
@ -386,10 +382,10 @@ sub add_result {
} }
if ($self->{global}->{total_read} && $self->{global}->{total_write}) { if ($self->{global}->{total_read} && $self->{global}->{total_write}) {
$self->{sum_global}->{sum_read_write} = $self->{global}->{total_read} + $self->{global}->{total_write}; $self->{sum_global}->{sum_read_write} = $self->{global}->{total_read} + $self->{global}->{total_write};
} }
if ($self->{global}->{total_read_iops} && $self->{global}->{total_write_iops}) { if ($self->{global}->{total_read_iops} && $self->{global}->{total_write_iops}) {
$self->{sum_global}->{sum_read_write_iops} = $self->{global}->{total_read_iops} + $self->{global}->{total_write_iops}; $self->{sum_global}->{sum_read_write_iops} = $self->{global}->{total_read_iops} + $self->{global}->{total_write_iops};
} }
} }
@ -418,7 +414,7 @@ sub manage_selection {
$oid =~ /\.(\d+)$/; $oid =~ /\.(\d+)$/;
my $instance = $1; my $instance = $1;
my $filter_name = $self->{results}->{$oid_diskIODevice}->{$oid}; my $filter_name = $self->{results}->{$oid_diskIODevice}->{$oid};
if (!defined($self->{option_results}->{device})) { if (!defined($self->{option_results}->{device}) || $self->{option_results}->{device} eq '') {
$self->add_result(instance => $instance); $self->add_result(instance => $instance);
next; next;
} }