Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22637

API host.get return field with incorrect name

XMLWordPrintable

    • Icon: Documentation task Documentation task
    • Resolution: Fixed
    • Icon: Major Major
    • 7.0 (plan)
    • 6.4.1
    • Documentation (D)
    • None
    • Sprint 99 (Apr 2023)
    • 0.1

      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"

            epulke Elina Pulke
            nher13 HERMITTE Nicolas
            Team C
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: