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

API Host.create() seems to be not working

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • None
    • 1.9.9 (beta)
    • API (A)
    • RHEL 5 clone, PostgreSQL 8.4, Perl 5.8.8 + Perl-JSON-RPC-0.96 + Perl-JSON-2.51

      I am trying to create a host in 1.9.9 using Zabbix API, but it fails.

      Here is my JSON-RPC object:
      {
      "params" : {
      "interfaces" : [

      { "useip" : 1, "ip" : "10.1.2.3", "type" : 1, "port" : 10050 }

      ,

      { "useip" : 1, "ip" : "10.1.2.3", "type" : 2, "port" : 161 }

      ],
      "groups" : [

      { "groupid" : "11" }

      ],
      "templates" : [

      { "templateid" : "10049" }

      ],
      "host" : "myhost1"
      },
      "auth" : "f201fa9018f8f59fca8aea5577aab156",
      "jsonrpc" : "2.0",
      "method" : "host.create",
      "id" : 7
      }

      I get the following error message:
      In create_host: Error:

      {"data":"Incorrect arguments passed to function","message":"Invalid params.","code":-32602}

      I have double checked that group and template ids do exist. I guess this might be a typo or brackets issue, but I can't find it.

      Host.create() call worked for me flawlessly in 1.8. I modified it for use with 1.9 according to this manual: http://www.zabbix.com/documentation/2.0/manual/appendix/api/host/create

      I'm very sorry if I have overlooked something, and this error is caused by my mistake, please forgive me in that case.

            Unassigned Unassigned
            sire Sergey Syreskin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: