I am having trouble retrieving a vCenter setting using the discovery.vSphereFindObjects function.
When checking the MOB the setting is shown as being here:
Managed Object Type: ManagedObjectReference:OptionManager
The property Path is:
Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]
And my pattern body is:
on host := Host created, confirmed where os_type = 'VMware vCenter Appliance';
vc_passExp := discovery.vSphereFindObjects(host, "OptionManager", ["VirtualCenter.VimPasswordExpirationInDays.value"]);
if vc_passExp then
for h in vc_passExp do
passExp := h.virtualCenter_VimPasswordExpirationInDays_value;
From testing though it would appear that discovery.vSphereFindObjects command is wrong since null is returned for vc_passExp .
I have tested the same approach successfully using the command used in the TKU:
discovery.vSphereFindObjects(host, "HostSystem", ["hardware.systemInfo.uuid"]);
however the PropertyPath for this value is Property Path: hardware.systemInfo doesn't have the "setting" prefix as it does for Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]
How can I discovery the value in Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"] ??
You can't do this. The VMware vSphere API will not allow use the property collector (which is used for recovering values) on an OptionManager object.