+ Ref #392
This commit is contained in:
parent
6ee977033d
commit
a6db7e1e95
|
@ -374,8 +374,10 @@ sub change_seconds {
|
|||
{ unit => 'm', value => 60 },
|
||||
{ unit => 's', value => 1 },
|
||||
];
|
||||
my %values = ('y' => 1, 'M' => 2, 'w' => 3, 'd' => 4, 'h' => 5, 'm' => 6, 's' => 7);
|
||||
|
||||
foreach (@$periods) {
|
||||
next if (defined($options{start}) && $values{$_->{unit}} < $values{$options{start}});
|
||||
my $count = int($options{value} / $_->{value});
|
||||
|
||||
next if ($count == 0);
|
||||
|
|
|
@ -89,7 +89,7 @@ sub run {
|
|||
|
||||
$self->{output}->output_add(severity => $exit_code,
|
||||
short_msg => sprintf("System uptime is: %s",
|
||||
centreon::plugins::misc::change_seconds(value => floor($value / 100))));
|
||||
centreon::plugins::misc::change_seconds(value => floor($value / 100), start => 'd')));
|
||||
|
||||
$self->{output}->display();
|
||||
$self->{output}->exit();
|
||||
|
|
Loading…
Reference in New Issue