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

Can't create a host with API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Incomplete
    • Icon: Major Major
    • None
    • 4.4.1
    • API (A)
    • Ubuntu 18.04.1 LTS / apache2.0

      Steps to reproduce: Create host with API 

      {
       "jsonrpc": "2.0",
       "method": "host.create",
       "params": {
       "host": "BondServer",
       "groups": [
       {
       "groupid": "37"
       }
       ],
       "templates": [
       {
       "templateid": "10186"
       }
       ],
       "interfaces": [
       {
       "port": "10050",
       "dns": "Name",
       "ip": "192.168.1.1",
       "type": 1,
       "userip": 0,
       "main": 1
       }
       ]
       },
       "auth": "5c3e6cb029e4cf175898587a168f2db5",
       "id": "2"
       } 

      Result:

      file : /usr/share/zabbix/include/classes/api/services/CHostInterface.php
       line : 234
       function : exception
       class : CApiService
       type : ::
       args : {100, Incorrect arguments passed to function.}
      file : /usr/share/zabbix/include/classes/api/services/CHostInterface.php
       line : 339
       function : checkInput
       class : CHostInterface
       type : ->
       args : {System.Object[], create}
      file : /usr/share/zabbix/include/classes/api/services/CHostInterface.php
       line : 419
       function : create
       class : CHostInterface
       type : ->
       args : {System.Object[]}
      file : /usr/share/zabbix/include/classes/api/services/CHost.php
       line : 812
       function : massAdd
       class : CHostInterface
       type : ->
       args : {@{hosts=; interfaces=System.Object[]}}
      file : /usr/share/zabbix/include/classes/api/services/CHost.php
       line : 637
       function : massAdd
       class : CHost
       type : ->
       args : {@{hosts=; templates=System.Object[]; interfaces=System.Object[]}}
      file : /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php
       line : 123
       function : create
       class : CHost
       type : ->
       args : {System.Object[]}
      file : /usr/share/zabbix/include/classes/core/CJsonRpc.php
       line : 88
       function : callMethod
       class : CLocalApiClient
       type : ->
       args : {host, create, @
      {host=BondServer; groups=System.Object[]; templates=System.Object[]; interfaces=System.Object[]}
      , f8bcf3b56015feeb536583cc9fb927ef}
      file : /usr/share/zabbix/api_jsonrpc.php
       line : 63
       function : execute
       class : CJsonRpc
       type : ->
       args : {} 

       

      Expected:
      New host.

            zabbix.support Zabbix Support Team
            SerhiiMatvieiev Serhii Matvieiev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: