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

item.get returns wrong templateid parameter

    XMLWordPrintable

Details

    • Problem report
    • Status: Confirmed
    • Trivial
    • Resolution: Unresolved
    • 5.4.1
    • None
    • API (A)
    • Tested in CentOS and Alpine LInux

    Description

      Problem:

      Under item.get calls, templateid returns the items's itemid of the template and not the templateid.

      On the docs (https://www.zabbix.com/documentation/current/manual/api/reference/item/object):

       

      templateid string (readonly) ID of the parent template item.

      Hint: Use the hostid property to specify the template that the item belongs to.|

       

      Proof of Concept:

       

      1) item.get and randomly picking an item, I should have 10001 here on templateid of Linux template:

       {
       "itemid": "29167",
       "name": "CPU interrupt time",
       "templateid": "29130"
       },

       

      2) template.get using the itemids of templateid:

       

      {
       "output": ["name", "templateid", "hostid"],
       "itemids": "29130",
       "sortfield": "name"
      }

       

       

      3) And here is it, the hostid 10001 of Linux template:

       

      {
       "jsonrpc": "2.0",
       "result": [
         {
           "itemid": "29130",
           "name": "CPU interrupt time",
           "templateid": "29093",
           "hostid": "10001"
         }
       ],
       "id": 8
      }

       

       

      Attachments

        Activity

          People

            zabbix.dev Zabbix Development Team
            isaqueprofeta Isaque Profeta dos Reis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: