Ad Widget

Collapse

Host.create: Incorrect arguments passed to function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davama
    Junior Member
    • Oct 2019
    • 22

    #1

    Host.create: Incorrect arguments passed to function

    [SOLVED] .... (couldnt figure out how to update the subject)

    Trying to add a host but keep getting this error:

    Code:
    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect arguments passed to function."},"id":2}

    Here is the data i am posting to the API:

    Code:
    {
    "jsonrpc": "2.0",
    "method": "host.create",
    "params": {
    "host": "nga0123.<redacted>.com",
    "interfaces": [
    {
    "type": "1",
    "main": "1",
    "ip": "172.20.6.75",
    "dns": "nga0123.<redacted>.com",
    "port": "10050"
    }
    ],
    "groups": [
    {
    "groupid": "5",
    "internal": "1"
    },
    {
    "groupid": "17"
    }
    ],
    "templates": [
    {
    "templateid": "10331"
    }
    ]
    },
    "id": 2,
    "auth": "b52e2fb185ee0658a2b3fd4d1d564326"
    }

    Environment info:
    Code:
    root@zabbix-server:/var/lib/zabbix# zabbix_server --version
    zabbix_server (Zabbix) 5.0.1
    Revision c2a0b03 25 May 2020, compilation time: May 28 2020 17:17:31
    
    Copyright (C) 2020 Zabbix SIA
    License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it according to
    the license. There is NO WARRANTY, to the extent permitted by law.
    
    This product includes software developed by the OpenSSL Project
    for use in the OpenSSL Toolkit (http://www.openssl.org/).
    
    Compiled with OpenSSL 1.1.1 11 Sep 2018
    Running with OpenSSL 1.1.1 11 Sep 2018
    My api user is Permissions Type "Zabbix Super Admin".

    I've looked at the documentation and this forum but cannot seem to figure out what I am doing wrong...

    Any input is much appreciated!

    -Dave
    Last edited by davama; 09-04-2021, 20:51.
  • davama
    Junior Member
    • Oct 2019
    • 22

    #2
    No response yet...

    I can confirm that my json file is good.
    Any input is much appreciated!

    Comment

    • gcalenko
      Zabbix developer
      • Mar 2017
      • 27

      #3
      According to API documentation page for interfaces object fields you are missing required field "useip".

      Comment

      • davama
        Junior Member
        • Oct 2019
        • 22

        #4
        gcalenko
        Thank you for the reply!!!
        I'll give it a try

        Thank you!

        Comment

        • davama
          Junior Member
          • Oct 2019
          • 22

          #5
          That was it!!
          Thank you gcalenko

          Marking Solved

          Comment

          Working...