Details

    • Incident report
    • Status: Closed
    • Major
    • Resolution: Won't fix
    • None
    • None
    • API (A)
    • linux

    Description

      Hi everyone,

      i am new to Zabbix.I recently started working with zabbix API. i am stuck at one point.

      i am trying to link multiple templates with one host which is created(host) using zabbix api. i don't know i am going wrong.

      Here is the jason:

      "jsonrpc":"2.0",
      "method":"host.create",
      "params":{
      "host":"srv-test-t005",
      "ip":"192.168.3.1",
      "port":10050,
      "useip":1,
      "groups":[

      { "groupid":7 }

      ],
      "templates":[

      { "templateid":10047 }

      ,

      { "templateid":10049 }

      ]
      },
      "auth":'.$res['result'].',
      "id":1
      }';

      which gives me an error: "Invalid JSON. An error occurred on the server while parsing the JSON text."

      Can you please guide me?

      Another thing i noticed that when i use php fuction json_decode() with above json the last templateid"10049 is gone in the php arrary. may be because of duplicate "templateid" entry.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sandeep.parekh sandeep parekh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: