-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'inventory_mode' when updating existing host via zabbix_agent role #385
Comments
Thank you for reporting this @tambetliiv . I will try to look into it more closer over the weekend |
Any current workaround, because for now our regular zabbix playbook fails and some quick fix would be appreciated until more permanent one is released. |
ping @D3DeFi would really like a fix or some workaround. Currently our envs zabbix playbook is broken because of this bug. Can't update any existing host info. |
I am also experiencing a very similar (or same?) problem since upgrading to 5.4:
|
@tambetliiv feel free to get to the bottom of this and prepare a pull request or document workaround for others. Since this is an open source community, any contribution is welcome. I, unfortunately, really don't have time to work on this right now. Zabbix doesn't have proper API as they are changing things left and right in each release without proper deprecation or anything and we are just not able to keep up with it proactively as there are already so few of us still maintaining these modules in our free time. I can give just pointers from what I've observed before:
Why this started happening? Did Zabbix developers released a bugged version? Since there is no information relating deprecation of this key in https://www.zabbix.com/documentation/current/manual/api/changes_5.4. or does this mean that Zabbix developers no longer wants us to configure behavior of inventory for Zabbix hosts? Same problem is happening in the issue regarding zabbix_template, Zabbix just changed behavior of API and it no longer does what it is supposed to be doing. @sky-joker would you perhaps have some time to look into this more? |
@D3DeFi, I reached to about the same conclusion. Created issue to zabbix support. Lets see what they have to say about this. Hopefully bug, that will be fixed quickly, but never know. |
Created very very dirty workaround which is ok for our env, since most hosts/all have |
I'm experiencing the same issue after upgrading the server to 5.4. How can I start to use this updated file?
|
found it, just created a folder |
It seems the reason for this is that on Zabbix 5.4 when you call the API for a host it no longer includes the inventory_host field. According to people on the Zabbix support page @tambetliiv raised, this is a bug and will be fixed in future versions however it still leaves 5.4 with this issue. I managed to get around this by adding a rule on the "get_host_by_host_name" function which requests the fields explicitly rather than asking for "all" which is bugged when using version 5.4. I will see about getting a fork of the repo for this, however, I'm not super familiar with the contributing process. Feel free to PM me if you require this fix now. |
SUMMARY
After zabbix server upgrade to
5.4.0
updating existing host data fails with error:ISSUE TYPE
COMPONENT NAME
Module:
zabbix_host.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version
Zabbix server: zabbix/zabbix-server-pgsql:alpine-5.4.0
Target machine which host data to be updated:
STEPS TO REPRODUCE
ansible
,sshpass
,docker
anddocker-compose
git clone [email protected]:tambetliiv/ansible-zabbix-debug.git
cd ansible-zabbix-debug
docker-compose up -d
ansible-playbook main.yml -i servers -u root -k
use ssh passwordroot
ansible-playbook main.yml -i servers -u root -k
second time and thisKeyError
will occur.EXPECTED RESULTS
Playbook should succeed in update existing host info
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: