ansible-zabbix-api icon indicating copy to clipboard operation
ansible-zabbix-api copied to clipboard

Hi :)

Open andyzasl opened this issue 9 years ago • 2 comments

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

andyzasl avatar May 20 '15 09:05 andyzasl

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.

r0bj avatar May 20 '15 19:05 r0bj

I have 2.0.11 Code was ran under python 2.7

andyzasl avatar May 21 '15 05:05 andyzasl