Open mattiasgeniar opened 9 years ago
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()));
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}'
=======
i tried above method bu get this error no permission to referred object or it does not exist
Action: user.authenticate Request:
Response:
user.authenticate is a deprecated alias of user.login