core: Zabbix Integration: API Logon fails, Integration uses wrong Parameter for username?
The problem
I tried to integrate my Zabbix 6.4 Server into Home Assistant as advised here.
To be more specific, my Integration in the configuration.yml looks like this:
zabbix: host: 192.168.0.6 username: redacted password: redacted include: domains: - 123test
When restarting Home Assistant, I get the following error message displayed as a notification in the GUI:
Unable to login to the Zabbix API: {'code': -32602, 'message': 'Invalid params.', 'data': 'Invalid parameter "/": unexpected parameter "user".', 'json': "{'jsonrpc': '2.0', 'method': 'user.login', 'params': {'user': 'redacted', 'password': '********'}, 'id': '1'}"
I had a look at the Zabbix API manual and have the impression that the paramter for the Username is not “user” anymore, but “username” instead.
I think that can be fixed in the init.py, but I do not feel confident enough to make the change on my own and file a pull request, so hopefully someone more proficient with Pythin and Git could have a look at it?
What version of Home Assistant Core has the issue?
core-2023.3.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Zabbix
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zabbix
Diagnostics information
No response
Example YAML snippet
configuration.yml
zabbix:
host: 192.168.0.6
username: redacted
password: redacted
include:
domains:
- 123test
Anything in the logs that might be useful for us?
Unable to prepare setup for platform zabbix.sensor: Unable to set up component.
08:19:09 – (FEHLER) setup.py
Setup failed for zabbix: Integration failed to initialize.
08:19:09 – (FEHLER) setup.py
Unable to login to the Zabbix API: {'code': -32602, 'message': 'Invalid params.', 'data': 'Invalid parameter "/": unexpected parameter "user".', 'json': "{'jsonrpc': '2.0', 'method': 'user.login', 'params': {'user': 'redacted', 'password': '********'}, 'id': '1'}"}
08:19:09 – (FEHLER) zabbix
Additional information
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 16
I think it’s too early to close the issue in its current form since the module remains broken
see #86879
Does anyone have this working? I have the latest versions of everything and I am still getting the following error in HA.
Same problem here. The error in the log is
` Logger: homeassistant.components.zabbix Source: components/zabbix/init.py:96 Integration: Zabbix (documentation, issues) First occurred: 10:54:33 (20 occurrences) Last logged: 11:23:26
HTTPError when connecting to Zabbix API: HTTP Error 412: Precondition Failed HTTP Error 412: Precondition Failed Retrying in 60 seconds. `
The Zabbix documentation states that user.authenticate is deprecated (see https://www.zabbix.com/documentation/2.0/en/manual/appendix/api/user/authenticate) and that API calls must set the Content-Type header to application/json (not sure, what exactly causes the issue).
still open - tried with the latest versions of home-assistant and zabbix
Still an issue. Just installed today the Zabbix integration today on the latest HA release.
Still an issue…:
There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I have the same problem since upgrading Zabbix to 6.4, worked fine in 6.2.