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

Issue with zabbix 2.0.0rc2 API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.0rc4
    • 2.0.0rc2
    • API (A)
    • Debian with MySQL
      API: v1.4

      When we create a host trough the API the JSON-error "no such error" is generated:

      JSON request that is sent:
      {"jsonrpc":"2.0","method":"host.create","params":{"host":"store3.internal.test","interfaces":[

      {"type":"2","main":"1","useip":"1","ip":"192.168.17.210","dns":"","port":"161"}

      ,

      {"type":"1","main":"1","useip":"1","ip":"192.168.17.210","dns":"","port":"10050"}

      ,

      {"type":"1","main":"0","useip":"1","ip":"172.16.80.26","dns":"","port":"10050"}

      ],"groups":

      {"groupid":"6"}

      ,"templates":[

      {"templateid":"10047"}

      ,

      {"templateid":"10134"}

      ,

      {"templateid":"10130"}

      ,

      {"templateid":"10049"}

      ]},"auth":"24aedcb501e25f50eac653fe183c6708","id":1}

      (all templateid's, groupid's and auth.hash are valid)

      Received:
      Got response from API: ({"jsonrpc":"2.0","error":

      {"code":-32400,"message":"System error.","data":"JSON-rpc error generation failed. No such error \"\"."}

      ,"id":1}) Response decoded: (Array ( [jsonrpc] => 2.0 [error] => Array ( [code] => -32400 [message] => System error. [data] => JSON-rpc error generation failed. No such error "". ) [id] => 1 )

      When I shorten the name to store3 and run it again, the host is succesfully added.
      (With the Zabbix php-frontend I can create a host with the name store3.internal.test and same templates/groups without issue).

      Is there a limitation on the hostname length for the host.create method?
      If my JSON is faulty, it would be nice to have an error different than just "System Error".

      Thanks for checking this out.

            Unassigned Unassigned
            simonris Simon Kerckhof
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: