fix 0 uptime value
This commit is contained in:
parent
13a4f415b0
commit
14c194723f
|
@ -392,6 +392,10 @@ sub change_seconds {
|
|||
$str_append = ' ';
|
||||
}
|
||||
|
||||
if ($str eq '') {
|
||||
$str = $options{value};
|
||||
$str .= $options{start} if (defined($options{start}));
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,12 +35,12 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"warning:s" => { name => 'warning' },
|
||||
"critical:s" => { name => 'critical' },
|
||||
"force-oid:s" => { name => 'force_oid' },
|
||||
"check-overload" => { name => 'check_overload' },
|
||||
"reboot-window:s" => { name => 'reboot_window', default => 5000 },
|
||||
"unit:s" => { name => 'unit', default => 's' },
|
||||
'warning:s' => { name => 'warning' },
|
||||
'critical:s' => { name => 'critical' },
|
||||
'force-oid:s' => { name => 'force_oid' },
|
||||
'check-overload' => { name => 'check_overload' },
|
||||
'reboot-window:s' => { name => 'reboot_window', default => 5000 },
|
||||
'unit:s' => { name => 'unit', default => 's' },
|
||||
});
|
||||
|
||||
$self->{statefile_cache} = centreon::plugins::statefile->new(%options);
|
||||
|
@ -123,8 +123,10 @@ sub run {
|
|||
$value = $self->check_overload(timeticks => $value);
|
||||
$value = floor($value / 100);
|
||||
|
||||
my $exit_code = $self->{perfdata}->threshold_check(value => floor($value / $unitdiv->{$self->{option_results}->{unit}}),
|
||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||
my $exit_code = $self->{perfdata}->threshold_check(
|
||||
value => floor($value / $unitdiv->{$self->{option_results}->{unit}}),
|
||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]
|
||||
);
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'uptime', unit => $self->{option_results}->{unit},
|
||||
value => floor($value / $unitdiv->{$self->{option_results}->{unit}}),
|
||||
|
|
Loading…
Reference in New Issue