[ZBX-22697] VMware tags are not reliably collected during VM discovery Created: 2023 Apr 19  Updated: 2024 Apr 10  Resolved: 2023 Jun 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 6.4.1
Fix Version/s: 6.4.4rc1, 7.0.0alpha2, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Nicola Mauri Assignee: Michael Veksler
Resolution: Fixed Votes: 2
Labels: Tags, VMware
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

VMware vCenter Server 7.0.2 build-18455184
zabbix-proxy-pgsql-6.2.9
Rocky Linux release 8.7


Attachments: PNG File LatestData1.png     PNG File LatestData2-after-zabbix-restart.png     File ZBX-22697-6.4.patch     PNG File vm-tags-item-timeout.png    
Team: Team B
Sprint: Sprint 100 (May 2023), Sprint 101 (Jun 2023)
Story Points: 1

 Description   

In the JSON generated by vmware.vm.discovery all discovered VMs have an empty "tags" element, even if vmware tags are actually defined in vSphere. It seems taht restarting zabbix_proxy, in most cases, makes appear tags again in the JSON. 

Since we use vmware tags to filter VMs that need to be discovered and monitored, this issue makes hosts to be randomly created and deleted from zabbix.

 

Steps to reproduce:

1. Create an host and apply VMware FQDN template

2. In the vmware.vm.discovery[] discovery rule: add a Javascript preprocessing step in order to write lld output to the logs

var obj = JSON.parse(value);
Zabbix.log(3, "VMdiscovery: "+JSON.stringify(obj));
return JSON.stringify(obj);

 

3. Observe JSON output in zabbix_proxy.log: "tags" element is empty.

843683:20230418:100956.685 VMdiscovery: 
      {
    "{#VM.UUID}": "503a502b-4ed7-b865-9999-8d0e514e34b6",
    "{#VM.ID}": "vm-28941",
    "{#VM.NAME}": "adfs01",
    "{#HV.NAME}": "xxxxxxxmgt03",
    "{#HV.UUID}": "4c4c4544-005a-3410-9999-b6c04f314c32",
    "{#HV.ID}": "host-21",
    "{#DATACENTER.NAME}": "xxxxxxxmgm01",
    "{#CLUSTER.NAME}": "xxxxxxxmgm01",
    "{#VM.IP}": "192.168.2.10",
    "{#VM.DNS}": "adfs01.xxxxxx",
    "{#VM.GUESTFAMILY}": "windowsGuest",
    "{#VM.GUESTFULLNAME}": "Microsoft Windows Server 2016 or later (64-bit)",
    "{#VM.FOLDER}": "xxxxxx-infrastructure",
    "{#VM.SNAPSHOT.COUNT}": 0,
    "{#VM.TOOLS.STATUS}": "guestToolsRunning",
    "{#VM.POWERSTATE}": "poweredOn",
    "{#DATASTORE.NAME}": "xxxxxx-02-ntx-mgm",
    "{#DATASTORE.UUID}": "399972f4-f7529f1a",
    "{#VM.RPOOL.ID}": "resgroup-28833",
    "{#VM.RPOOL.PATH}": "xxxxxx-infrastructure",
    "vm.customattribute": [
      {
        "name": "LastBackupStatus",
        "value": "Successful: 2023-04-18 03:06:00 UTC"
      },
    ],
    "tags": []
    },

....

    ]

 

4. Restart zabbix and look again at zabbix-proxy.log: "tags" element is now properly collected.

# systemctl restart zabbix-proxy
# systemctl status zabbix-proxy

zabbix-proxy.service - Zabbix Proxy
   Active: active (running) since Tue 2023-04-18 11:01:53 CEST; 

3819356:20230418:110956.470 VMdiscovery: 
    [
    {
      "{#VM.UUID}": "503a502b-4ed7-b865-9999-8d0e514e34b6",
      "{#VM.ID}": "vm-28941",
      "{#VM.NAME}": "adfs01",
      "{#HV.NAME}": "xxxxxxxmgt03",
      "{#HV.UUID}": "4c4c4544-005a-3410-9999-b6c04f314c32",
      "{#HV.ID}": "host-21",
      "{#DATACENTER.NAME}": "xxxxxxxmgm01",
      "{#CLUSTER.NAME}": "xxxxxxxmgm01",
      "{#VM.IP}": "192.168.2.10",
      "{#VM.DNS}": "adfs01.xxxxxx",
      "{#VM.GUESTFAMILY}": "windowsGuest",
      "{#VM.GUESTFULLNAME}": "Microsoft Windows Server 2016 or later (64-bit)",
      "{#VM.FOLDER}": "xxxxxx-infrastructure",
      "{#VM.SNAPSHOT.COUNT}": 0,
      "{#VM.TOOLS.STATUS}": "guestToolsRunning",
      "{#VM.POWERSTATE}": "poweredOn",
      "{#DATASTORE.NAME}": "xxxxxx-02-ntx-mgm",
      "{#DATASTORE.UUID}": "399972f4-f7529f1a",
      "{#VM.RPOOL.ID}": "resgroup-28833",
      "{#VM.RPOOL.PATH}": "xxxxxx-infrastructure",
      "vm_customattribute": [
        {
          "name": "LastBackupStatus",
          "value": "Successful: 2023-04-18 03:06:00 UTC"
{{        }}}
      ],
      "tags": [
        {
          "name": "IT-OPERATION",
          "description": "",
          "category": "Monitoring-Department"
        },
        {
          "name": "YES",
          "description": "",
          "category": "Monitoring-Agent"
{{        }}}
      ]
    },
    
    ....
    
    ]

     

 



 Comments   
Comment by Edgar Akhmetshin [ 2023 Apr 20 ]

Hello Nicola,

We need DebugLevel=4 for "vmware collector" process.

Also to get the error happened with tags could you add to the VM template this item:

vmware.vm.tags.get[url,uuid]

https://www.zabbix.com/documentation/current/en/manual/vm_monitoring/vmware_keys

This item should return error, if tag is not handled properly.

Regards,
Edgar

Comment by Nicola Mauri [ 2023 Apr 20 ]

Hello Edgar, thanks for your suggestions.

I'm working to provide a simple, minimale case with DebugLevel.

In the meantime: I added the vmware.tags.get item and it returns "Timeout was reached" (see attached screenshot). After restarting Zabbix proxy, the item start to be properly collected, for some time at least.

Please note that this installation is also affected by ZBX-22513, which looks somehow related.

Thanks

Comment by Michael Veksler [ 2023 Apr 21 ]

Hello Nicola,
This is native curl error.

  case CURLE_OPERATION_TIMEDOUT:
    return "Timeout was reached";

Is this possible due to vmware session expiration timeout?

Regards,
Michael

Comment by Nicola Mauri [ 2023 Apr 21 ]

Hello Michael,

well, in theory it could be. But I cannot explain why this happens always and only during tags retrieving and not when gathering other vmware metrics.

Comment by Michael Veksler [ 2023 Apr 21 ]

Hello Nicola,

Tags subsystem is not soap but rest endpoint with different authentication process

I still can't imagine what's going on, but still:

  1. do you have something related in vmware event log ?
  2. do you have SourceIP param ?
  3. do you have network IDS ? (what did tcpdump say ?)
  4. did it work before ?
Comment by Nicola Mauri [ 2023 Apr 24 ]

Hello Michael

  • do you have something related in vmware event log?  NO
  • do you have SourceIP param?  YES
  • do you have network IDS ?   NO 
  • did it work before? NO

I suspect that it could be caused by SourceIP option and ZBX-22513 which causes connections from vmware collector to be originated from different IP addresses.

We'll upgrade to 6.4.1 and let you know.

Thanks

 

Comment by Nicola Mauri [ 2023 May 11 ]

Hello, 

we upgraded to 6.4.2 but unfortunately issue still persists.

Although we are not able to consistently reproduce the problem, it always recovers after restarting zabbix-proxy daemon.

 

 

Comment by Michael Veksler [ 2023 May 11 ]

Hello bitmind,

Next time when we catch the "weird" state, change the debug level to trace only for the "vmware collector"

I need to understand - which phase is not working: authentication or data query (I suspect that authentication phase)

zabbix_server -R log_level_increase="vmware collector"
zabbix_server -R log_level_increase="vmware collector" 

Try to find "vmware_service_rest_authenticate" string and all subsequent lines.

Comment by Nicola Mauri [ 2023 May 18 ]

Hi Michael

here are some excerpts from the debug log. As far as I can understand, all calls complete with SUCCESS status, however tags list is still empty in the JSON.

 

zabbix_proxy.log:

...
1030283:20230513:235127.905 End of vmware_entry_tags_init() entity tags:360
1030283:20230513:235127.906 zbx_vmware_service_update_tags() vc version:702
1030283:20230513:235127.906 In vmware_curl_init()
1030283:20230513:235127.906 End of vmware_curl_init():SUCCEED
1030283:20230513:235127.906 In vmware_service_rest_authenticate() 'zabbix'@'https://172.16.242.20/sdk'
1030283:20230513:235128.146 End of vmware_service_rest_authenticate():SUCCEED
1030283:20230513:235128.146 In vmware_tags_get() obj_id:host-576209
1030283:20230513:235128.146 In vmware_tags_linked_id() obj_id:host-576209
1030283:20230513:235128.146 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.299 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.299 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.299 End of vmware_tags_get() found tags:0
1030283:20230513:235128.299 In vmware_tags_get() obj_id:host-565268
1030283:20230513:235128.299 In vmware_tags_linked_id() obj_id:host-565268
1030283:20230513:235128.299 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.313 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.313 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.313 End of vmware_tags_get() found tags:0
1030283:20230513:235128.313 In vmware_tags_get() obj_id:host-393146
1030283:20230513:235128.313 In vmware_tags_linked_id() obj_id:host-393146
1030283:20230513:235128.313 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.322 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.322 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.322 End of vmware_tags_get() found tags:0
1030283:20230513:235128.322 In vmware_tags_get() obj_id:host-423275
1030283:20230513:235128.322 In vmware_tags_linked_id() obj_id:host-423275
1030283:20230513:235128.322 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.330 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.330 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.330 End of vmware_tags_get() found tags:0
1030283:20230513:235128.330 In vmware_tags_get() obj_id:host-161
1030283:20230513:235128.330 In vmware_tags_linked_id() obj_id:host-161
1030283:20230513:235128.330 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.345 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.345 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.345 End of vmware_tags_get() found tags:0
1030283:20230513:235128.345 In vmware_tags_get() obj_id:host-22
1030283:20230513:235128.345 In vmware_tags_linked_id() obj_id:host-22
1030283:20230513:235128.345 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.359 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.360 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.360 End of vmware_tags_get() found tags:0
1030283:20230513:235128.360 In vmware_tags_get() obj_id:datastore-491307
1030283:20230513:235128.360 In vmware_tags_linked_id() obj_id:datastore-491307
1030283:20230513:235128.360 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.371 vmware_tags_linked_id() REST response: []
1030283:20230513:235128.371 End of vmware_tags_linked_id() ids:0
1030283:20230513:235128.371 End of vmware_tags_get() found tags:0
1030283:20230513:235128.371 In vmware_tags_get() obj_id:host-608104
1030283:20230513:235128.371 In vmware_tags_linked_id() obj_id:host-608104
1030283:20230513:235128.371 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.386 vmware_tags_linked_id() REST response: []
...
1030283:20230513:235128.448 In vmware_tags_get() obj_id:vm-180856
1030283:20230513:235128.448 In vmware_tags_linked_id() obj_id:vm-180856
1030283:20230513:235128.448 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.462 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL","urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
1030283:20230513:235128.462 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.462 vmware_vectors_update() tag_id:urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL
1030283:20230513:235128.462 vmware_vectors_update() request url:https://172.16.242.20/api/cis/tagging/tag/urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL
1030283:20230513:235128.464 vmware_vectors_update() REST response: {"category_id":"urn:vmomi:InventoryServiceCategory:ae0b1adc-4134-4c85-bcba-265cfbbe3409:GLOBAL","name":"COM-GP-VTGP","description":"Backup - VMware Tools Guest Processing","id":"urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL","used_by":[]}
1030283:20230513:235128.464 vmware_vectors_update() request url:https://172.16.242.20/api/cis/tagging/category/urn:vmomi:InventoryServiceCategory:ae0b1adc-4134-4c85-bcba-265cfbbe3409:GLOBAL
1030283:20230513:235128.466 vmware_vectors_update() REST response: {"associable_types":[],"name":"Backup","description":"Veeam Backup","id":"urn:vmomi:InventoryServiceCategory:ae0b1adc-4134-4c85-bcba-265cfbbe3409:GLOBAL","used_by":[],"cardinality":"MULTIPLE"}
1030283:20230513:235128.466 vmware_vectors_update() tag name:'COM-GP-VTGP' description:'Backup - VMware Tools Guest Processing' category:'Backup'
1030283:20230513:235128.466 vmware_vectors_update() tag_id:urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL
1030283:20230513:235128.466 vmware_vectors_update() request url:https://172.16.242.20/api/cis/tagging/tag/urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL
...
1030283:20230513:235128.819 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.828 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL"]
1030283:20230513:235128.828 End of vmware_tags_linked_id() ids:1
1030283:20230513:235128.828 End of vmware_tags_get() found tags:1
1030283:20230513:235128.828 In vmware_tags_get() obj_id:vm-569868
1030283:20230513:235128.828 In vmware_tags_linked_id() obj_id:vm-569868
1030283:20230513:235128.828 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.838 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:67a90c01-1949-4374-874a-c6b08d2a29ed:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL","urn:vmomi:InventoryServiceTag:874ff47f-809d-4add-8170-e6eef0cc53e9:GLOBAL"]
1030283:20230513:235128.838 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.838 End of vmware_tags_get() found tags:3
1030283:20230513:235128.838 In vmware_tags_get() obj_id:vm-190621
1030283:20230513:235128.838 In vmware_tags_linked_id() obj_id:vm-190621
1030283:20230513:235128.838 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.847 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:9942a236-b40c-42c4-ac1e-efaf6e77079e:GLOBAL","urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
1030283:20230513:235128.847 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.847 End of vmware_tags_get() found tags:3
1030283:20230513:235128.847 In vmware_tags_get() obj_id:vm-292822
1030283:20230513:235128.847 In vmware_tags_linked_id() obj_id:vm-292822
1030283:20230513:235128.847 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.857 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:9942a236-b40c-42c4-ac1e-efaf6e77079e:GLOBAL","urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
1030283:20230513:235128.857 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.857 End of vmware_tags_get() found tags:3
1030283:20230513:235128.857 In vmware_tags_get() obj_id:vm-555922
1030283:20230513:235128.857 In vmware_tags_linked_id() obj_id:vm-555922
1030283:20230513:235128.857 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.866 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL","urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
1030283:20230513:235128.866 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.866 End of vmware_tags_get() found tags:3
1030283:20230513:235128.866 In vmware_tags_get() obj_id:vm-395674
1030283:20230513:235128.866 In vmware_tags_linked_id() obj_id:vm-395674
1030283:20230513:235128.866 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.877 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:9942a236-b40c-42c4-ac1e-efaf6e77079e:GLOBAL","urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
1030283:20230513:235128.877 End of vmware_tags_linked_id() ids:3
1030283:20230513:235128.877 End of vmware_tags_get() found tags:3
1030283:20230513:235128.877 In vmware_tags_get() obj_id:vm-311
1030283:20230513:235128.877 In vmware_tags_linked_id() obj_id:vm-311
1030283:20230513:235128.877 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235128.886 vmware_tags_linked_id() REST response: ["urn:vmomi:InventoryServiceTag:67a90c01-1949-4374-874a-c6b08d2a29ed:GLOBAL","urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL","urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL"]
....
1030283:20230513:235131.935 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235131.943 vmware_tags_linked_id() REST response: []
1030283:20230513:235131.943 End of vmware_tags_linked_id() ids:0
1030283:20230513:235131.943 End of vmware_tags_get() found tags:0
1030283:20230513:235131.943 In vmware_tags_get() obj_id:datastore-564499
1030283:20230513:235131.943 In vmware_tags_linked_id() obj_id:datastore-564499
1030283:20230513:235131.943 vmware_tags_linked_id() request url:https://172.16.242.20/api/cis/tagging/tag-association?action=list-attached-tags
1030283:20230513:235131.951 vmware_tags_linked_id() REST response: []
1030283:20230513:235131.951 End of vmware_tags_linked_id() ids:0
1030283:20230513:235131.951 End of vmware_tags_get() found tags:0
1030283:20230513:235131.955 End of zbx_vmware_service_update_tags():SUCCEED tags:615
1030283:20230513:235131.955 End of vmware_job_exec() type:update_tags ret:SUCCEED
1030283:20230513:235131.955 In vmware_job_schedule() queue:29 type:update_tags
1030283:20230513:235131.955 End of vmware_job_schedule() type:update_tags nextcheck:23:52:27
1030283:20230513:235131.955 In vmware_job_get() queue:30
1030283:20230513:235131.955 End of vmware_job_get() queue:30 type:none
1030283:20230513:235131.955 In vmware_job_get() queue:30
1030283:20230513:235131.955 End of vmware_job_get() queue:30 type:none
1030283:20230513:235132.955 zbx_setproctitle() title:'vmware collector #5 [updated 1, removed 0 VMware services, idle 1.000000 sec during 5.050012 sec]'

Comment by Michael Veksler [ 2023 May 19 ]

Hello Nikola,
As I can see:
1. no HV tags received. Do you receive tags from HV after proxy reboot or does HV  have not any tags?
2. and I did not find any "timeout". Are you seeing a timeout error if you are asking tags for selected host ?

If possible - run proxy with additional logs:

diff --git a/src/zabbix_server/vmware/vmware_rest.c b/src/zabbix_server/vmware/vmware_rest.c
index 5d70d400b05..d06d293049f 100644
--- a/src/zabbix_server/vmware/vmware_rest.c
+++ b/src/zabbix_server/vmware/vmware_rest.c
@@ -633,6 +633,9 @@ static int  vmware_rest_post(const char *fn_parent, CURL *easyhandle, const char
        CURLcode        err;
        CURLoption      opt;
 
+       if (NULL != fn_parent)
+               zabbix_log(LOG_LEVEL_TRACE, "%s() POST request: %s", fn_parent, request);
+
        if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_POST, 1L)) ||
                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_POSTFIELDS, request)))
        {
 

and show me output of tags from one host (this is example of curl script for tags requests)

h=vcenter7.host
u='[email protected]'
p='password'
pu='api'


cg="curl -s -k -X GET"
cp="curl -s -k -X POST"

t=`curl -s -k -X POST https://${h}/api/session -u "${u}":"${p}" | tr -d '"'`
echo "--- token:[$t]"

echo "--- category list:"
$cg "https://${h}/${pu}/cis/tagging/category" -H "vmware-api-session-id: ${t}"|jq
echo "--- tags list:"
$cg "https://${h}/${pu}/cis/tagging/tag" -H "vmware-api-session-id: ${t}"|jq
echo "--- tags list of host-576209"
$cp "https://${h}/${pu}/cis/tagging/tag-association?action=list-attached-tags" -H "vmware-api-session-id: ${t}" -H 'Content-type: application/json' -d '{ "object_id": { "id": "host-576209", "type": "HostSystem" } }'|jq
echo "--- logout"
curl -X DELETE 'https://vcenter7.zabbix.sandbox/api/session' -H "vmware-api-session-id: ${t}"
 
Comment by Nicola Mauri [ 2023 May 19 ]

Hi Michael, thanks four your feedback.

1) No vSphere tags are defined on Hypervisors (vmware "hosts") at the moment.

2) Yes. Asking for tags returns "Timeout was reached" (see attached latest data screen)

3) run proxy with additional logs:  at the momento we can't recompile zabbix, as this is a production environment. But, if necessary, we can try to setup a test environment.

4) show me output of tags from one host: This is the result. I'm not sure about that: shouldn't we ask for VM tags instead of host tags?

--- token:[a3612aee97d83de7dd62ef1b8*********]
--- category list:
[
  "urn:vmomi:InventoryServiceCategory:0d4f7a62-cdc9-4f77-ac8f-f4247e6b20a3:GLOBAL",
  "urn:vmomi:InventoryServiceCategory:ae0b1adc-4134-4c85-bcba-265cfbbe3409:GLOBAL",
  "urn:vmomi:InventoryServiceCategory:0ed3c82d-a82d-48f4-9da8-1092755993f4:GLOBAL"
]
--- tags list:
[
  "urn:vmomi:InventoryServiceTag:67a90c01-1949-4374-874a-c6b08d2a29ed:GLOBAL",
  "urn:vmomi:InventoryServiceTag:eecf4090-bb00-49dd-b2db-0c1b1760a8f8:GLOBAL",
  "urn:vmomi:InventoryServiceTag:9942a236-b40c-42c4-ac1e-efaf6e77079e:GLOBAL",
  "urn:vmomi:InventoryServiceTag:f121ee08-b52a-40e3-b853-016ce0c77f69:GLOBAL",
  "urn:vmomi:InventoryServiceTag:d2407c68-f0d3-4a56-bfbf-b431b587e7bb:GLOBAL",
  "urn:vmomi:InventoryServiceTag:6b0fb8a6-db67-48be-bd8d-139761504650:GLOBAL",
  "urn:vmomi:InventoryServiceTag:788290ea-2ace-4009-bcd3-ab3095513c7f:GLOBAL",
  "urn:vmomi:InventoryServiceTag:0268ccda-1d4d-47f0-9e5a-b3450afd6486:GLOBAL",
  "urn:vmomi:InventoryServiceTag:751cff6e-016e-4286-893c-fc4fa23fac27:GLOBAL",
  "urn:vmomi:InventoryServiceTag:e63042dd-6fd0-462a-ae47-d494033decc2:GLOBAL",
  "urn:vmomi:InventoryServiceTag:0035d563-8170-43e2-83dc-8286b574d2b3:GLOBAL",
  "urn:vmomi:InventoryServiceTag:874ff47f-809d-4add-8170-e6eef0cc53e9:GLOBAL"
]
--- tags list of host-576209
[]
--- logout

 

Comment by Michael Veksler [ 2023 May 23 ]

Hello Nikola,

Be so kind to test the patch ZBX-22697-6.4.patch

I think I found the problem and thanks for the help.

(But the cause  of the error is unreliable communication network, I recommend checking the network - after testing the patch )

Comment by Nicola Mauri [ 2023 May 23 ]

Thanks Michael. Please allow a few days to recompile zabbix and setup a proper test environment. I'll update this issue as soon as possible.

Comment by Dimitri Bellini [ 2023 May 29 ]

Hi Michael,
I saw your comment on VMWare Tags but I do not understand why you say "unreliable communication network". To collect Tags it's not the same TCP Port of VMWare general monitoring (HTTPS/443)?
Thanks so much

Comment by Michael Veksler [ 2023 May 30 ]

Hi dimitri.bellini,

We do vmware monitoring via https/443 - you are right

cause of the error is that it not erased when network issue is restored, but it means that at least 1 time curl got the "timeout" error (not application level)!

Comment by Dimitri Bellini [ 2023 May 30 ]

Hi Michael,
ok thanks but a single not working/timeout "CURL" can impact all the "tags" also for the next requests?
Could you put something on the log to understand better this kind of scenraios? I.E. RestAPI for VMware data it's working and RestAPI for Tags not working?
Thanks so much

PS: Maybe I did not understand how it works

Comment by Michael Veksler [ 2023 Jun 01 ]

Hi dimitri.bellini,

This is the right question. The answer is based on our vmware information collection architecture. We are trying to prevent the vc from being destroyed if any user configures to collect some metrics every second. Therefore, we collect all the data(VMwareFrequency & VMwarePerfFrequency) in our cache and generate a response based on our cache.

As for this case, I forgot to remove the error while restoring the network connection from our cache and all responses returned with an error, despite the fact that all data about tags was in memory (our dev network is very reliable ).

Comment by Dimitri Bellini [ 2023 Jun 01 ]

ahhaha, ok understood!
I hope to provide you a feedback.
Thanks

Comment by Michael Veksler [ 2023 Jun 09 ]

Available in:

Generated at Sat Dec 13 23:10:04 EET 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.