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

API host.create error

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.4.3
    • API (A)
    • None

      Hello, when I'm trying to execute host.create method, faced with error: No permissions to referred object or it does not exist!

      Full response:

       

      {
        "error": {
          "code": -32500,
          "data": "No permissions to referred object or it does not exist!",
          "message": "Application error."
        },
        "jsonrpc": "2.0",
        "id": 1
      }
      

      User have Super admin role and full access to hosts and templates:

       

      Request body:

       

      {
        "params": {
          "host": "hostfqdn",
          "inventory_mode": 1,
          "proxy_hostid": "10001",
          "groups": [
            {
              "groupid": 123
            },
            {
              "groupid": 345
            },
            {
              "groupid": 678
            }
          ],
          "inventory": {
            "site_state": "some desc with ascii simbols like привет",
            "site_country": "some desc with ascii simbols like привет",
            "vendor": "Vendor",
            "site_address_a": "some desc with ascii simbols like привет",
            "deployment_status": "some desc with ascii simbols like привет",
            "contact": "Not defined",
            "location_lon": "12.345678",
            "serialno_a": "ABC123",
            "installer_name": "name",
            "location_lat": "12.345678",
            "site_zip": "123456",
            "site_city": "some desc with ascii simbols like привет",
            "model": "Model",
            "date_hw_expiry": "2023.07.12 21:41:38 (Created)",
            "site_rack": "01A23",
            "type_full": "some desc with ascii simbols like привет",
            "type": "SOMEDEVICE",
            "name": "hostname",
            "notes": "",
            "url_a": "https://zabbix.com",
            "site_notes": "Ìàø.çàë ¹2 Ðÿä F",
            "location": "some desc with ascii simbols like привет"
          },
          "status": 0,
          "interfaces": [
            {
              "details": {
                "version": 2,
                "community": "{$SNMP_COMMUNITY}"
              },
              "port": 161,
              "ip": "hostip",
              "type": 2,
              "useip": 1,
              "dns": "hostdns",
              "main": 1
            }
          ],
          "templates": [
            10567
          ],
          "name": "hostname"
        },
        "auth": "blablabla",
        "jsonrpc": "2.0",
        "id": 1,
        "method": "host.create"
      }
      

       

       

            agavrilovs Aleksandrs Petrovs-Gavrilovs
            Evgeny.Semerikov@x5.ru Evgeny Semerikov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: