unioslo / zabbix-cli

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

Error -32602: Invalid params.: Invalid parameter "/output/2": value must be one of "proxyid", "name" ... #169

Closed tjyang closed 11 months ago

tjyang commented 12 months ago

- [7.0 API Doc](https://www.zabbix.com/documentation/devel/en/manual/api)
pederhan commented 12 months ago

It seems like a bunch of proxy-related properties (Proxy.name, Host.proxyid, and more?) have been renamed in 7.0.

I have a branch with a temporary fix here: https://github.com/pederhan/zabbix-cli/tree/fix-login-7-0-bandaid

I am working on a more robust solution that solves this a bit more elegantly, but I need to actually understand the full extent of what was changed in 7.0 first.

tjyang commented 12 months ago

@pederhan

Big thanks for 7.0 API fix, It almost worked.

[me@t01 ~]$ ls -l .zabbix-cli_auth .zabbix-cli/zabbix-cli.conf
-r-------- 1 tjyang domain users  14 Nov 25 10:16 .zabbix-cli_auth
-rw-r--r-- 1 tjyang domain users 595 Nov 25 10:18 .zabbix-cli/zabbix-cli.conf
[me@t01 ~]$
[me@t01 ~]$  zabbix-cli
<snipped>
/usr/lib/python3.6/site-packages/urllib3/connectionpool.py:1052: InsecureRequestWarning: Unverified HTTPS request is being made to host 'ilclnagios03.mot.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,

[ERROR]:'host'

[me@t01 ~]$ 
pederhan commented 12 months ago

Oh, that's weird. It worked for me on my empty local Zabbix 7.0 instance, but I encounter the same error now after adding a proxy to it.

tjyang commented 12 months ago

@pederhan , you are correct. My test zabbix-server have 5 proxy severs configured.

pederhan commented 12 months ago

Sorry for the inconvenience, but since the bandaid fix didn't pan out, I'm just going to keep these new changes in the main branch I'm working on: https://github.com/pederhan/zabbix-cli/tree/fix-login-7-0

Try it out to see if it solves the issue for you.

tjyang commented 12 months ago

I am grateful of your effort and fix. I will keep checking the latest comment at https://github.com/pederhan/zabbix-cli/commits/fix-login-7-0. To see if it fix the zabbix 7 alpha 7 with proxy servers configured.

tjyang commented 11 months ago

@pederhan ,Thanks for the fixes in fix-login-7-0. I can now connect to 7.0a7 zabbix server with proxy servers configured.

#############################################################
Welcome to the Zabbix command-line interface (v2.3.1)
Connected to server https://test03/zabbix (v7.0.0)
#############################################################
Type help or \? to list commands.

[zabbix-cli Admin@test03]$
[zabbix-cli Admin@test03.test.com]$ shell uname

[Error]: Problems running uname

[zabbix-cli Admin@test03$
pederhan commented 11 months ago

I'll create a new issue for that, since the original issue you had seems to be resolved.

pederhan commented 11 months ago

Fixed in #173