mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
use regexp instead of Date parser
This commit is contained in:
parent
50dcd19cec
commit
b9e815010d
@ -41,7 +41,6 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::httplib;
|
use centreon::plugins::httplib;
|
||||||
use JSON;
|
use JSON;
|
||||||
use DateTime::Format::ISO8601;
|
|
||||||
|
|
||||||
my $thresholds = {
|
my $thresholds = {
|
||||||
state => [
|
state => [
|
||||||
@ -182,8 +181,8 @@ sub run {
|
|||||||
$result = $keys;
|
$result = $keys;
|
||||||
$containername = $webcontent->{Name};
|
$containername = $webcontent->{Name};
|
||||||
$containername =~ s/^\///;
|
$containername =~ s/^\///;
|
||||||
my $dt = DateTime::Format::ISO8601->parse_datetime($webcontent->{State}->{StartedAt});
|
my ( $y, $m, $d, $h, $mi, $s ) = $webcontent->{State}->{StartedAt} =~ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
|
||||||
$containertime = $dt->strftime('%F %T');
|
$containertime = $y."-".$m."-".$d." ".$h.":".$mi.":".$s;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user