ansible-zabbix-api
ansible-zabbix-api copied to clipboard
Hi :)
I've find an issue and fixed it. The problem raises when running sync_host against already hosts, which already exists.
failed: [111.11.11.11] => {"failed": true, "parsed": false} Traceback (most recent call last): File "/root/.ansible/tmp/ansible-tmp-1432113100.98-34784592966175/zabbix-api", line 2205, in <module> main() File "/root/.ansible/tmp/ansible-tmp-1432113100.98-34784592966175/zabbix-api", line 576, in main templates, File "/root/.ansible/tmp/ansible-tmp-1432113100.98-34784592966175/zabbix-api", line 385, in sync_host self.__compare_ip(hostdump, ip) File "/root/.ansible/tmp/ansible-tmp-1432113100.98-34784592966175/zabbix-api", line 312, in __compare_ip if interface['main'] == '1': TypeError: string indices must be integers
Thanks @andyzasl Unfortunately I cannot replicate this issue. What version of zabbix do you use? Could you provide a xml dump of host causing this issue?
In my case hostdump['interfaces'] is a list (not dict) so index iteration is a proper one.
I have 2.0.11 Code was ran under python 2.7