Source
static void vmware_service_props_load(CURL *easyhandle, const char *collector, zbx_vector_cq_value_ptr_t *cq_values)
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/*
* The VMware data (zbx_vmware_service_t structure) are stored in shared memory.
* This data can be accessed with zbx_vmware_get_service() function and is regularly
* updated by VMware collector processes.
*
* When a new service is requested by poller the zbx_vmware_get_service() function
* creates a new service object, marks it as new, but still returns NULL object.
*
* The collectors check the service object list for new services or services not updated
* during last config_vmware_frequency seconds. If such service is found it is marked
* as updating.
*
* The service object is updated by creating a new data object, initializing it
* with the latest data from VMware vCenter (or Hypervisor), destroying the old data
* object and replacing it with the new one.
*
* The collector must be locked only when accessing service object list and working with
* a service object. It is not locked for new data object creation during service update,
* which is the most time consuming task.
*
* As the data retrieved by VMware collector can be quite big (for example 1 Hypervisor
* with 500 Virtual Machines will result in approximately 20 MB of data), VMware collector
* updates performance data (which is only 10% of the structure data) separately
* with config_vmware_perf_frequency period. The performance data is stored directly
* in VMware service object entities vector - so the structure data is not affected by
* performance data updates.
*/
static zbx_mutex_t vmware_lock = ZBX_MUTEX_NULL;
static zbx_vmware_t *vmware = NULL;
static zbx_hashset_t evt_msg_strpool;
ZBX_PTR_VECTOR_IMPL(vmware_service_ptr, zbx_vmware_service_t *)
ZBX_PTR_VECTOR_IMPL(str_uint64_pair, zbx_str_uint64_pair_t)
ZBX_PTR_VECTOR_IMPL(vmware_datacenter_ptr, zbx_vmware_datacenter_t *)
ZBX_PTR_VECTOR_IMPL(vmware_diskextent_ptr, zbx_vmware_diskextent_t *)
ZBX_VECTOR_IMPL(vmware_hvdisk, zbx_vmware_hvdisk_t)
ZBX_PTR_VECTOR_IMPL(vmware_dsname_ptr, zbx_vmware_dsname_t *)
ZBX_PTR_VECTOR_IMPL(vmware_pnic_ptr, zbx_vmware_pnic_t *)
ZBX_PTR_VECTOR_IMPL(vmware_custom_attr_ptr, zbx_vmware_custom_attr_t *)
ZBX_PTR_VECTOR_IMPL(custquery_param, zbx_vmware_custquery_param_t)
ZBX_PTR_VECTOR_IMPL(vmware_dvswitch_ptr, zbx_vmware_dvswitch_t *)
ZBX_PTR_VECTOR_IMPL(vmware_alarm_ptr, zbx_vmware_alarm_t *)
ZBX_PTR_VECTOR_IMPL(vmware_diskinfo_ptr, zbx_vmware_diskinfo_t *)