Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zabbix 2.4: authenticatie API point changed name #44

Open
mattiasgeniar opened this issue Dec 24, 2014 · 3 comments
Open

Zabbix 2.4: authenticatie API point changed name #44

mattiasgeniar opened this issue Dec 24, 2014 · 3 comments

Comments

@mattiasgeniar
Copy link
Owner

Action: user.authenticate
Request:

{  
   "auth":null,
   "method":"user.authenticate",
   "id":1,
   "params":{  
      "user":"xxx",
      "password":"xxx"
   },
   "jsonrpc":"2.0"
}

Response:

{  
   "jsonrpc":"2.0",
   "error":{  
      "code":-32602,
      "message":"Invalid params.",
      "data":"Incorrect method user.authenticate."
   },
   "id":1
}

user.authenticate is a deprecated alias of user.login

@MASantangelo
Copy link

class_zabbix @ 161,39: change user.authenticate to user.login --- this works for me. I know this is old but I just saw your stuff and I'm playing with it on Zabbix 2.4.

So line 161 goes from:

$result = $this->sendRequest("user.authenticate", array("user" => $this->getUsername(), "password" => $this->getPassword()));

to

$result = $this->sendRequest("user.login", array("user" => $this->getUsername(), "password" => $this->getPassword()));

MASantangelo added a commit to MASantangelo/MoZBX that referenced this issue Apr 16, 2015
@intrepidsilence
Copy link

This only fixes part of the issue. It appears that aping is still being called with auth in it which no longer works. You need a different function defined without auth to pre-login requests like apiinfo.

Source IP: 10.x.x.x
API URL: http://zabbix-server.localdomain/zabbix/api_jsonrpc.php
Action: apiinfo.version
Request:
'{"auth":"<hash>","method":"apiinfo.version","id":1,"params":[],"jsonrpc":"2.0"}'

Response:
'{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"The \\"apiinfo.version\\" method must be called without the \\"auth\\" parameter."},"id":1}'
=======

@wayneward
Copy link

i tried above method bu get this
error no permission to referred object or it does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants