[ZBX-22637] API host.get return field with incorrect name Created: 2023 Apr 04  Updated: 2024 Apr 10  Resolved: 2023 Apr 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: 6.4.1
Fix Version/s: 7.0 (plan)

Type: Documentation task Priority: Major
Reporter: HERMITTE Nicolas Assignee: Elina Pulke (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team C
Sprint: Sprint 99 (Apr 2023)
Story Points: 0.1

 Description   

Steps to reproduce:

  1. Run an API request to host.get method with selectHostGroups param :

 

{    "jsonrpc": "2.0",    "method": "host.get",    "params": {        "filter": {            "host": [                "Zabbix server",                "Linux server"            ]        },        "selectHostGroups": "extend"    },    "id": 1,    "auth": "{{auth}}"} 

 

Result:

{    "jsonrpc": "2.0",    "result": [        {            "hostid": "10084",            "proxy_hostid": "0",            "host": "Zabbix server",            "status": "0",            "ipmi_authtype": "-1",            "ipmi_privilege": "2",            "ipmi_username": "",            "ipmi_password": "",            "maintenanceid": "0",            "maintenance_status": "0",            "maintenance_type": "0",            "maintenance_from": "0",            "name": "Zabbix server",            "flags": "0",            "templateid": "0",            "description": "",            "tls_connect": "1",            "tls_accept": "1",            "tls_issuer": "",            "tls_subject": "",            "proxy_address": "",            "auto_compress": "1",            "custom_interfaces": "0",            "uuid": "",            "inventory_mode": "-1",            "active_available": "0",            "hostgroups": [                {                    "groupid": "4",                    "name": "Zabbix servers",                    "flags": "0",                    "uuid": "6f6799aa69e844b4b3918f779f2abf08"                }            ]        }    ],    "id": 1} 

hostgroups ids are under a key named "hostgroups" whereas the documentation (https://www.zabbix.com/documentation/current/en/manual/api/reference/host/get)  said the key is named "groups". In previous versions ( change seems to occure in 6.2)  the key was also named "groups"

Expected:
The key name must be "groups" and not "hostgroups"



 Comments   
Comment by Arturs Dancis [ 2023 Apr 11 ]

Documentation updated:

Generated at Sat Aug 02 09:51:15 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.