southbridgeio / zabbix-review-export-import

Clone of zabbix-review-export with added import object(s) feature
https://gitlab.com/devopshq/zabbix-review-export
50 stars 30 forks source link

Tipo de importação #8

Closed ivanmirandaf closed 3 years ago

ivanmirandaf commented 3 years ago

O script zabbix-import.py aceita apenas arquivos YAML?

evgkrsk commented 3 years ago

Yes, just as stated in README.

ivanmirandaf commented 3 years ago

Não entendi bem o README Estou executando python3 zabbix-import.py --zabbix-url http://localhost/zabbix --zabbix-username Admin --zabbix-password zabbix --debug --type host hosts/* e no final eu tenho a mensagem:

2021-05-05 10:04:08,963 DEBUG Loading from XML-exported YAML 2021-05-05 10:04:08,964 ERROR TypeError('string indices must be integers',) Traceback (most recent call last): File "zabbix-import.py", line 1780, in maint_cache=maintenance2id, File "zabbix-import.py", line 1490, in main yml = yml["zabbix_export"] TypeError: string indices must be integers 2021-05-05 10:04:08,980 ERROR Some operations failed

evgkrsk commented 3 years ago

Please narrow down to one problematic input file and attach (or add link to) it and full debug output of zabbix-import.py.

Also, what python and OS version do you have?

ivanmirandaf commented 3 years ago

log.txt

RB260 - Almas.txt

Python 3.6.8 CentOS 7 Zabbix 5.0.11

evgkrsk commented 3 years ago

Please, try to import with code from xml-import-detection-8 git branch (#9). log.txt is created without --debug CLI flag, please use it this time.

Obvious, you trying to import host from non-supported XML file instead on YAML, but at least we can print more clear error message in such case.

ivanmirandaf commented 3 years ago

Fiz a alteração no código mesmo assim o problema continua. log.txt

evgkrsk commented 3 years ago

As I say before, you trying to import from XML file, but only YAML is supported. Now clear message about that will be printed.