Only in zabbix-2.2.1: config.log diff -u -r zabbix-2.2.1.orig/src/zabbix_server/vmware/vmware.c zabbix-2.2.1/src/zabbix_server/vmware/vmware.c --- zabbix-2.2.1.orig/src/zabbix_server/vmware/vmware.c 2013-12-09 18:15:13.000000000 +0900 +++ zabbix-2.2.1/src/zabbix_server/vmware/vmware.c 2014-01-29 15:49:19.942924636 +0900 @@ -1943,9 +1943,22 @@ "" \ ZBX_POST_VSPHERE_FOOTER +# define ZBX_POST_VCENTER_HV_LIST_CONTINUE \ + ZBX_POST_VSPHERE_HEADER \ + "" \ + "propertyCollector" \ + "%s" \ + "" \ + ZBX_POST_VSPHERE_FOOTER + +# define ZBX_XPATH_RETRIEVE_PROPERTIES_TOKEN \ + "/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='RetrievePropertiesExResponse']" \ + "/*[local-name()='returnval']/*[local-name()='token']" + const char *__function_name = "vmware_service_get_hv_list"; int err, opt, ret = FAIL; + char tmp[MAX_STRING_LEN], *token; zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __function_name); @@ -1971,6 +1984,37 @@ goto out; zbx_xml_read_values(page.data, "//*[@type='HostSystem']", hvs); + + if (NULL != (token = zbx_xml_read_value(page.data, ZBX_XPATH_RETRIEVE_PROPERTIES_TOKEN))) + { + zabbix_log(LOG_LEVEL_DEBUG, "%s() token: %s", __function_name, token); + do + { + zbx_snprintf(tmp, sizeof(tmp), ZBX_POST_VCENTER_HV_LIST_CONTINUE, token); + + if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_POSTFIELDS, tmp))) + { + *error = zbx_dsprintf(*error, "Cannot set cURL option [%d]: %s", opt, curl_easy_strerror(err)); + goto out; + } + + page.offset = 0; + + if (CURLE_OK != (err = curl_easy_perform(easyhandle))) + { + *error = zbx_strdup(*error, curl_easy_strerror(err)); + goto out; + } + + zabbix_log(LOG_LEVEL_DEBUG, "%s() page.data:'%s'", __function_name, page.data); + if (NULL != (*error = zbx_xml_read_value(page.data, ZBX_XPATH_LN1("faultstring")))) + goto out; + + zbx_xml_read_values(page.data, "//*[@type='HostSystem']", hvs); + + token = zbx_xml_read_value(page.data, ZBX_XPATH_RETRIEVE_PROPERTIES_TOKEN); + } while (NULL != token); + } } else {