Ad Widget

Collapse

Error proxy.update - Zabbix API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • un tecnico mas
    Junior Member
    • Apr 2022
    • 10

    #1

    Error proxy.update - Zabbix API

    Hello,

    I am getting the following error:
    I have a list of computers assigned to a proxy, I add a new host and I want it to be managed by a proxy.

    I launch the following query.
    {
    "jsonrpc": "2.0",
    "method": "proxy.update",
    "params": {
    "proxyid": "10524",
    "hosts": [
    { "hostid": "11116"}
    ]
    },
    "auth": "-------------------------------",
    "id": 1
    }

    Now the host is managed by the proxy, but the rest of the hosts are not.
    I know there are parameters that the Zabbix API removes if they do not appear, but in this case it is not specified in the documentation and I seem to remember that "proxy.update - hosts" did not work this way.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Hi, unfortunately I don't have experience on that, but this sounds like a good case to open an issue in https://support.zabbix.com or submit an improvement request for the documentation (select the text in the documentation and press Ctrl-Enter).

    Markku

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      According to the Frontend devs it was always so that you have to specify all existing hosts when adding a new one. But I agree, adding this information to the documentation would make sense. Please create a Jira issue as "documentation task".

      Comment

      • vladimir_lv
        Senior Member
        • May 2022
        • 240

        #4
        You need to assign a proxy to the host and not vice versa.
        Code:
        json={
            "jsonrpc": "2.0",
            "method": "host.update",
            "params": {
                "hostid": host["hostid"],
                "proxy_hostid":YOUR_PROXY_ID
            },
            "id": 1,
            "auth": YOUR_TOKEN
        }
        Last edited by dimir; 02-08-2022, 11:05.

        Comment

        Working...