From 118e1f677db266a1fce2912a785d49540ddf803e Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Wed, 11 Dec 2024 17:13:58 +0100 Subject: [PATCH] fix: Fix ESX virtualmachine boot time support --- lib/GLPI/Agent/SOAP/VMware/Host.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/GLPI/Agent/SOAP/VMware/Host.pm b/lib/GLPI/Agent/SOAP/VMware/Host.pm index 166caabbb..ea76bcaae 100644 --- a/lib/GLPI/Agent/SOAP/VMware/Host.pm +++ b/lib/GLPI/Agent/SOAP/VMware/Host.pm @@ -448,7 +448,10 @@ sub getVirtualMachines { } } unless (empty($machine->{summary}{runtime}{bootTime})) { - $vmInventory->{OPERATINGSYSTEM}->{BOOT_TIME} = $machine->{summary}{runtime}{bootTime}; + my ($bootdate, $boottime) = + $machine->{summary}{runtime}{bootTime} =~ /^([0-9-]+).(\d+:\d+:\d+)/; + $boottime = "$bootdate $boottime" if $bootdate && $boottime; + $vmInventory->{OPERATINGSYSTEM}->{BOOT_TIME} = $boottime if $boottime; } }