Skip to content

Commit

Permalink
fix: Fix ESX virtualmachine boot time support
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Dec 11, 2024
1 parent cfc50ec commit 118e1f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/GLPI/Agent/SOAP/VMware/Host.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 118e1f6

Please sign in to comment.