monitoringartist / zapix

Online Zabbix API tool - test and develope Zabbix API queries in the browser
http://monitoringartist.github.io/zapix/
Other
184 stars 46 forks source link

Zabbix 6.4 requires another parameter for user.login #8

Open zalexua opened 1 year ago

zalexua commented 1 year ago

https://www.zabbix.com/documentation/5.4/en/manual/api/changes_5.2_-_5.4 ZBXNEXT-6474 user.login: Renamed parameter user → username.

https://www.zabbix.com/documentation/6.4/en/manual/api/changes ZBXNEXT-8085 user.login: Removed support for deprecated parameter user.

So, starting from 6.4, in jsonrpc.js:21 instead of: this.call('user.login', {user: user, password: pass}, function(result) { must be: this.call('user.login', {username: user, password: pass}, function(result) {

jangaraj commented 1 year ago

Thank you Oleksii. Do you have an idea how to make it backward compatible? Can you create PR, please?

zalexua commented 1 year ago

I'm not JS programmer, so I could not prepare a PR, sorry.

It probably makes sense to check firsts API version and then, based on the results, use corresponding data for Login request. https://www.zabbix.com/documentation/6.4/en/manual/api/reference/apiinfo/version

JayTea144 commented 6 months ago

Any plans on fixing this? I just tried it and still doesn't work. user --> username

jangaraj commented 6 months ago

@JayTea144 @zalexua Could you test, pls? This should fix a problem - https://github.com/monitoringartist/zapix/commit/9fbc251478adf2cc91a1043e22c5b8fb96185714 but I'm not able to test it on my own.