This commit is contained in:
garnier-quentin 2016-05-03 14:03:06 +02:00
parent 6ee977033d
commit a6db7e1e95
2 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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();