mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 08:04:36 +02:00
Fix #392
This commit is contained in:
parent
a94612e1cf
commit
245c86f245
@ -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
|
||||||
@ -90,7 +89,7 @@ sub run {
|
|||||||
|
|
||||||
$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).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user