Ad Widget

Collapse

Cant get data from zabbix API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sperr0w
    Member
    • Oct 2014
    • 44

    #1

    Cant get data from zabbix API

    Hello!

    I have zabbix 2.2 on Oracle linux and remote Oracle database.

    now from zabbix server putty session I try this:

    curl -i -X POST -H*'Content-Type:application/json'*-d'{"jsonrpc": "2.0","method":"user.authenticate","params":{"user ":"Admin","password":"zabbix"},"auth": null,"id":0}'*http://127.0.0.1/zabbix/api_jsonrpc.php

    Here I get "auth":

    HTTP/1.1 200 OK
    Date: Thu, 13 Nov 2014 12:51:24 GMT
    Server: Apache/2.2.15 (Oracle)
    X-Powered-By: PHP/5.3.3
    Content-Length: 68
    Connection: close
    Content-Type: application/json

    {"jsonrpc":"2.0","result":"0602c579a1f5267bc976514 578f9322d","id":0}

    Then I start :

    curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"o utput":"extend"},"auth":"0602c579a1f5267bc97651457 8f9322d","id":1}' http://127.0.0.1/zabbix/api_jsonrpc.php

    That must return me all hosts.

    But it return this:

    HTTP/1.1 200 OK
    Date: Thu, 13 Nov 2014 12:51:41 GMT
    Server: Apache/2.2.15 (Oracle)
    X-Powered-By: PHP/5.3.3
    Content-Length: 36
    Connection: close
    Content-Type: application/json

    {"jsonrpc":"2.0","result":[],"id":1}

    Actially I have more than 100 servers.

    the same thing about any object list.

    Where am I wrong?
  • sperr0w
    Member
    • Oct 2014
    • 44

    #2
    With user.login instead of user.authenticate also empty list of data.

    Comment

    Working...