Ad Widget

Collapse

Zabbix API issue.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HaveDill
    Senior Member
    • Sep 2014
    • 103

    #1

    Zabbix API issue.

    Hello,

    I've previously followed this guide and had it functioning on a prebuild Zabbix ISO.


    I'm trying to reimplement it on a fresh Ubuntu version of Zabbix, however i keep running into issues.

    I've read that it is an authentication issue, but my user and password are correct. Also i've tried with the URL as both http://192.168.105.248/zabbix/api_jsonrpc.php and http://192.168.105.248/api_jsonrpc.php

    Can someone please give me some input?? This is really frustrating me and i can't find anything online.

    Also when i put print $res before line 62 i get this:

    Code:
    HTTP/1.1 200 OK
    Date: Thu, 02 Oct 2014 16:21:07 GMT
    Server: Apache/2.4.7 (Ubuntu)
    X-Powered-By: PHP/5.5.9-1ubuntu4.4
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type
    Access-Control-Allow-Methods: POST
    Access-Control-Max-Age: 1000
    Content-Length: 125
    Content-Type: application/json
    
    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect method \"user.authenticate\"."},"id":0}
    
    HTTP/1.1 200 OK
    Date: Thu, 02 Oct 2014 16:21:07 GMT
    Server: Apache/2.4.7 (Ubuntu)
    X-Powered-By: PHP/5.5.9-1ubuntu4.4
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type
    Access-Control-Allow-Methods: POST
    Access-Control-Max-Age: 1000
    Content-Length: 101
    Content-Type: application/json
    
    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Not authorised."},"id":1}



    ^ With http://192.168.105.248/zabbix/api_jsonrpc.php

    ^ with http://192.168.105.248/api_jsonrpc.php


    Last edited by HaveDill; 02-10-2014, 18:48.
  • simoon
    Junior Member
    • May 2014
    • 8

    #2
    In Zabbix 2.4 user.login method from API must be called without the auth parameter in the JSON-RPC request.



    Watch for this method in your scripts and modify.

    Or install Zabbix 2.2

    Comment

    • MgMonte
      Junior Member
      • Feb 2010
      • 5

      #3
      missing API methods in Zabbix 2.4

      There are many modifications in Zabbix 2.4 API .
      The method "user.authenticate" is no more available and in some other calls some parameters has changed .
      I had to modify the "api_jsonrpc.php" to allow many apps present on the market to continue working.
      In particular I had to change "user.authenticate" into "user.login" and to remove the "auth" parameter in the 'apiinfo.version' call.

      Massimo

      Comment

      Working...