unioslo / zabbix-cli

Command-line interface for Zabbix
https://unioslo.github.io/zabbix-cli/
GNU General Public License v3.0
208 stars 105 forks source link

Fix username login param for Zabbix>=6.4 #167

Closed pederhan closed 1 year ago

pederhan commented 1 year ago

The application now chooses the correct user.login parameter based on the Zabbix version it is running against (username on >=5.4, otherwise user). The username parameter was added in 5.4, while user was removed in 6.4, hence we use username from 5.4 and onwards.

The application now fetches the Zabbix API version before login instead of after to facilitate this new behavior.

A new property zabbix_cli.pyzabbix.ZabbixAPI.version has been added, which returns the Zabbix API version as a packaging.version.Version. This is a cached property, which we re-use in zabbix_cli.cli.zabbixcli to set the zabbix_version attribute.

Fixes #160.