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

Zabbix User is able to create screens through API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.0.9
    • API (A)

      Using the API a user, who is a Zabbix User (rather than Zabbix Admin), with Read-Write to a host group is able to create screens. Below are some curl commands I was able to run to recreate the problem. After running the third, I am able to navigate to the newly created screen in the web UI.

      [kristopher@zabbix ~]$ curl -i -X POST -H "Content-Type: application/json" -d '{
      "jsonrpc": "2.0",
      "method": "user.login",
      "params":

      { "user": "rstallman", "password": "zabbix" }

      ,
      "id": 1
      }' http://zabbix.domain.com/zabbix/api_jsonrpc.php && echo
      HTTP/1.1 200 OK
      Date: Fri, 22 Nov 2013 17:45:29 GMT
      Server: Apache/2.2.15 (CentOS)
      X-Powered-By: PHP/5.3.3
      Content-Length: 68
      Connection: close
      Content-Type: application/json

      {"jsonrpc":"2.0","result":"6a0757cfb6d320135bd39ed4183d865a","id":1}

      [kristopher@zabbix ~]$ curl -i -X POST -H "Content-Type: application/json" -d '{
      "jsonrpc": "2.0",
      "method": "user.get",
      "params":

      { "output": "extend" }

      ,
      "auth": "6a0757cfb6d320135bd39ed4183d865a",
      "id": 1
      }' http://zabbix.domain.com/zabbix/api_jsonrpc.php && echo

      HTTP/1.1 200 OK
      Date: Fri, 22 Nov 2013 18:22:36 GMT
      Server: Apache/2.2.15 (CentOS)
      X-Powered-By: PHP/5.3.3
      Content-Length: 287
      Connection: close
      Content-Type: application/json

      {"jsonrpc":"2.0","result":[

      {"userid":"4","alias":"rstallman","name":"Richard","surname":"Stallman","url":"","autologin":"1","autologout":"0","lang":"en_GB","refresh":"30","type":"1","theme":"default","attempt_failed":"0","attempt_ip":"","attempt_clock":"0","rows_per_page":"50"}

      ],"id":1}

      [kristopher@zabbix ~]$ curl -i -X POST -H "Content-Type: application/json" -d '{
      "jsonrpc": "2.0",
      "method": "screen.create",
      "params":

      { "name": "New Screen", "hsize": 3, "vsize": 2 }

      ,
      "auth": "6a0757cfb6d320135bd39ed4183d865a",
      "id": 1
      }' http://zabbix.domain.com/zabbix/api_jsonrpc.php && echo
      HTTP/1.1 200 OK
      Date: Fri, 22 Nov 2013 18:20:53 GMT
      Server: Apache/2.2.15 (CentOS)
      X-Powered-By: PHP/5.3.3
      Content-Length: 2
      Connection: close
      Content-Type: application/json

      []

            Unassigned Unassigned
            asciiduck Kristopher Kirkland
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: