Fix value, division by 100 refs #5554

This commit is contained in:
Kevin Duret 2014-05-19 12:29:44 +02:00
parent 974505caa3
commit 8366c9c7de

View File

@ -90,13 +90,13 @@ sub run {
$exit_code = $self->{perfdata}->threshold_check(value => $valueRuntime, $exit_code = $self->{perfdata}->threshold_check(value => $valueRuntime,
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->perfdata_add(label => 'runtime', $self->{output}->perfdata_add(label => 'runtime',
value => $valueRuntime, value => floor($valueRuntime / 100),
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0); min => 0);
$self->{output}->output_add(severity => $exit_code, $self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("PfSense running since : %s", short_msg => sprintf("PfSense running since : %s",
defined($self->{option_results}->{seconds}) ? $valueRuntime . " seconds" : floor($valueRuntime / 86400) . " days" )); defined($self->{option_results}->{seconds}) ? floor($valueRuntime / 100) . " seconds" : floor($valueRuntime / 86400 / 100) . " days" ));
} else { } else {
$self->{output}->perfdata_add(label => 'runtime', $self->{output}->perfdata_add(label => 'runtime',