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

[data] => [ CHost::delete ] You do not have permission to perform this operation

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • 1.8.4
    • None
    • API (A)
    • None

      Output of PHP using the API to delete a host:

      CURL URL: http://zabbix01/api_jsonrpc.php
      CURL Options: Array
      (
      [19913] => 1
      [13] => 30
      [78] => 5
      [81] =>
      [64] =>
      [52] => 1
      [74] => 1
      [10023] => Array
      (
      [0] => Content-Type: application/json-rpc
      [1] => User-Agent: ZabbixAPI v1.0 - http://andrewfarley.com/zabbix_php_api
      )

      [10036] => POST
      [10015] => {"auth":null,"method":"user.authenticate","id":1,"params":

      {"password":"test","user":"api"}

      ,"jsonrpc":"2.0"}
      [10102] => gzip
      )
      Got response from API: (

      {"jsonrpc":"2.0","result":"75e096eefd4761c213a06c30876c8367","id":1}

      )

      Deleting host Zabbix server
      CURL URL: http://zabbix01/api_jsonrpc.php
      CURL Options: Array
      (
      [19913] => 1
      [13] => 30
      [78] => 5
      [81] =>
      [64] =>
      [52] => 1
      [74] => 1
      [10023] => Array
      (
      [0] => Content-Type: application/json-rpc
      [1] => User-Agent: ZabbixAPI v1.0 - http://andrewfarley.com/zabbix_php_api
      )

      [10036] => POST
      [10015] => {"auth":"75e096eefd4761c213a06c30876c8367","method":"host.delete","id":1,"params":

      {"hostid":"10017"}

      ,"jsonrpc":"2.0"}
      [10102] => gzip
      )
      Got response from API: ({"jsonrpc":"2.0","error":

      {"code":-32500,"message":"Application error.","data":"[ CHost::delete ] You do not have permission to perform this operation"}

      ,"id":1})
      Response decoded: (Array
      (
      [jsonrpc] => 2.0
      [error] => Array
      (
      [code] => -32500
      [message] => Application error.
      [data] => [ CHost::delete ] You do not have permission to perform this operation
      )

      [id] => 1
      )

      User "api" is Super admin and has API access. Creating and deleting hostgroups works fine.

            Unassigned Unassigned
            verwilst Bart Verwilst
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: