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

item.get returns wrong templateid parameter

XMLWordPrintable

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

      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
      }

       

       

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

              Created:
              Updated: