Skip to content

Commit 118e1f6

Browse files
committed
fix: Fix ESX virtualmachine boot time support
1 parent cfc50ec commit 118e1f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/GLPI/Agent/SOAP/VMware/Host.pm

+4-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,10 @@ sub getVirtualMachines {
448448
}
449449
}
450450
unless (empty($machine->{summary}{runtime}{bootTime})) {
451-
$vmInventory->{OPERATINGSYSTEM}->{BOOT_TIME} = $machine->{summary}{runtime}{bootTime};
451+
my ($bootdate, $boottime) =
452+
$machine->{summary}{runtime}{bootTime} =~ /^([0-9-]+).(\d+:\d+:\d+)/;
453+
$boottime = "$bootdate $boottime" if $bootdate && $boottime;
454+
$vmInventory->{OPERATINGSYSTEM}->{BOOT_TIME} = $boottime if $boottime;
452455
}
453456
}
454457

0 commit comments

Comments
 (0)