From c4863abca559e6516feff8c3c02c5ebec1d67e77 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 26 May 2015 17:21:20 +0200 Subject: [PATCH] + mode radlan 'cpu': add unit '%' --- centreon/common/radlan/mode/cpu.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/centreon/common/radlan/mode/cpu.pm b/centreon/common/radlan/mode/cpu.pm index 05ae641ff..f84973f5a 100644 --- a/centreon/common/radlan/mode/cpu.pm +++ b/centreon/common/radlan/mode/cpu.pm @@ -107,28 +107,28 @@ sub run { my $cpu5min = $self->{result}->{$oid_rlCpuUtilDuringLast5Minutes}; my $exit1 = $self->{perfdata}->threshold_check(value => $cpu1sec, - threshold => [ { label => 'crit1s', 'exit_litteral' => 'critical' }, { label => 'warn1s', exit_litteral => 'warning' } ]); + threshold => [ { label => 'crit1s', exit_litteral => 'critical' }, { label => 'warn1s', exit_litteral => 'warning' } ]); my $exit2 = $self->{perfdata}->threshold_check(value => $cpu1min, - threshold => [ { label => 'crit1m', 'exit_litteral' => 'critical' }, { label => 'warn1m', exit_litteral => 'warning' } ]); + threshold => [ { label => 'crit1m', exit_litteral => 'critical' }, { label => 'warn1m', exit_litteral => 'warning' } ]); my $exit3 = $self->{perfdata}->threshold_check(value => $cpu5min, - threshold => [ { label => 'crit5m', 'exit_litteral' => 'critical' }, { label => 'warn5m', exit_litteral => 'warning' } ]); + threshold => [ { label => 'crit5m', exit_litteral => 'critical' }, { label => 'warn5m', exit_litteral => 'warning' } ]); my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2, $exit3 ]); $self->{output}->output_add(severity => $exit, short_msg => sprintf("CPU Usage: %.2f%% (1sec), %.2f%% (1min), %.2f%% (5min)", $cpu1sec, $cpu1min, $cpu5min)); - $self->{output}->perfdata_add(label => "cpu_1s", + $self->{output}->perfdata_add(label => "cpu_1s", unit => '%', value => $cpu1sec, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1s'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1s'), min => 0, max => 100); - $self->{output}->perfdata_add(label => "cpu_1m", + $self->{output}->perfdata_add(label => "cpu_1m", unit => '%', value => $cpu1min, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn1m'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit1m'), min => 0, max => 100); - $self->{output}->perfdata_add(label => "cpu_5m", + $self->{output}->perfdata_add(label => "cpu_5m", unit => '%', value => $cpu5min, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warn5m'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'crit5m'),