Ad Widget

Collapse

Error when trying to add a URL via the API.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • UncleSam
    Junior Member
    • Aug 2013
    • 5

    #1

    Error when trying to add a URL via the API.

    Zabbix ver 4.0.0-1.1alpha3
    Trying to add a URL to the map element through the API.
    Every time I get this error

    Link selementid1 field is pointing to a nonexistent map selement ID \"129\"

    129 Every time, no matter what in my request.

    I didn't find any examples. How should the correct minimum query look?
    Tell me, what am i doing wrong? (Besides using the alpha version of zabbix).

    request 1
    Code:
    { 
    "jsonrpc": "2.0", 
    "method": "map.update", 
    "params": { 
        "sysmapid": "5", 
        "selements": [{ 
             "selementid": "125", 
             "urls":[ { "name":"SSH","url":"ssh://10.26.16.179" }]    
          }] 
    } , 
    "id": 16, 
    "auth": "1106ed67f51c55c6d1e12b119543005c" 
    }
    answer 1
    Code:
    {
    "jsonrpc":"2.0",
    "error":{
        "code":-32602,
        "message":"Invalid params.",
        "data":"Link selementid1 field is pointing to a nonexistent map selement ID \"129\" for map \"NET_Core_2\"."
    },
    "id":16
    }

    request 2
    Code:
    { 
    "jsonrpc": "2.0", 
    "method": "map.update", 
    "params": { 
        "sysmapid": "5", 
        "selements": [ { 
            "selementid": "128", 
            "urls":[ { "name":"SSH","url":"ssh://10.26.16.89" }] 
         }] 
    } , 
    "id": 31, 
    "auth": "1106ed67f51c55c6d1e12b119543005c" 
    }
    answer 2
    Code:
    {
    "jsonrpc":"2.0",
    "error":{
        "code":-32602,
        "message":"Invalid params.",
        "data":"Link selementid1 field is pointing to a nonexistent map selement ID \"129\" for map \"NET_Core_2\"."
    },
    "id":31
    }
  • UncleSam
    Junior Member
    • Aug 2013
    • 5

    #2
    Del theme

    Itself asked, itself answered.
    For some reason I decided that the items on the map can be updated one by one.
    No you can't. You must update all items at once. Otherwise, the system considers that all other items should be removed, and reports on the relationship between non-existent elements.
    Stupid question was, I should have read the instructions better.

    Comment

    Working...