1 Reply Latest reply on Aug 9, 2017 1:06 PM by Andrew Waters

    vSphereFindObjects - Not find object

    David Rough

      Hello

       

      I am having trouble retrieving a vCenter setting using the discovery.vSphereFindObjects function.

       

      When checking the MOB the setting is shown as being here:

       

      https://myVC/mob/?moid=VpxSettings

       

      Managed Object Type: ManagedObjectReference:OptionManager

       

      The property Path is:

       

      Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]

       

      And my pattern body is:

      triggers

          on host := Host created, confirmed where os_type = 'VMware vCenter Appliance';

      end triggers;

       

      body

          vc_passExp := discovery.vSphereFindObjects(host, "OptionManager", ["VirtualCenter.VimPasswordExpirationInDays.value"]);

              if vc_passExp then

                  for h in vc_passExp do

                      passExp := h.virtualCenter_VimPasswordExpirationInDays_value;

                      log.debug('%passExp%');

                  end for;

              end if;

      end body;

       

      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"]  ??