This commit is contained in:
garnier-quentin 2016-05-02 21:04:46 +02:00
parent a94612e1cf
commit 245c86f245
1 changed files with 3 additions and 8 deletions

View File

@ -25,6 +25,7 @@ use base qw(centreon::plugins::mode);
use strict; use strict;
use warnings; use warnings;
use POSIX; use POSIX;
use centreon::plugins::misc;
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
@ -36,7 +37,6 @@ sub new {
{ {
"warning:s" => { name => 'warning', }, "warning:s" => { name => 'warning', },
"critical:s" => { name => 'critical', }, "critical:s" => { name => 'critical', },
"seconds" => { name => 'seconds', },
"force-oid:s" => { name => 'force_oid', }, "force-oid:s" => { name => 'force_oid', },
}); });
@ -59,7 +59,6 @@ sub check_options {
sub run { sub run {
my ($self, %options) = @_; my ($self, %options) = @_;
# $options{snmp} = snmp object
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
# To be used first for OS # To be used first for OS
@ -89,8 +88,8 @@ sub run {
min => 0); min => 0);
$self->{output}->output_add(severity => $exit_code, $self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("System uptime is: %s", short_msg => sprintf("System uptime is: %s",
defined($self->{option_results}->{seconds}) ? floor($value / 100) . " seconds" : floor($value / 86400 / 100) . " days" )); centreon::plugins::misc::change_seconds(value => floor($value / 100))));
$self->{output}->display(); $self->{output}->display();
$self->{output}->exit(); $self->{output}->exit();
@ -114,10 +113,6 @@ Threshold warning in seconds.
Threshold critical in seconds. Threshold critical in seconds.
=item B<--seconds>
Display uptime in seconds.
=item B<--force-oid> =item B<--force-oid>
Can choose your oid (numeric format only). Can choose your oid (numeric format only).