Skip to content
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

[ERROR]:cannot concatenate 'str' and 'exceptions.UnicodeEncodeError' objects #122

Open
fauust opened this issue Apr 21, 2020 · 3 comments
Open
Assignees

Comments

@fauust
Copy link

fauust commented Apr 21, 2020

Hi!
First of all, thank you for this great tool!

I am facing a problem when I export template items into a CSV file.
Zabbix command-line interface: v2.2.1
Zabbix Version: v4.4.7
Template : official (Template OS Windows by Zabbix agent active).

Here is the command I used:

zabbix-cli -C "show_items \"Template OS Windows by Zabbix agent active\"" >template.txt
zabbix-cli -o csv -C "show_items \"Template OS Windows by Zabbix agent active\"" >template.csv
zabbix-cli -o json -C "show_items \"Template OS Windows by Zabbix agent active\"" >template.json

Here are the exported files:
https://paste.debian.net/1141865/ (txt)
https://paste.debian.net/1141864/ (csv)
https://paste.debian.net/1141863/ (json)

Only the json export seems to work.

The same happens when "piping" the output into less for instance:

zabbix-cli -C "show_items \"Template OS Windows by Zabbix agent active\"" | less

Without redirection in a file (or using a pipe), the export works perfectly on all the output formats.

I can't understand if

  • it's some python encoding bug;
  • there is a bad character into zabbix official template;
  • something else...

Any help really appreciated!

@paalbra paalbra self-assigned this May 4, 2020
@paalbra
Copy link
Contributor

paalbra commented May 5, 2020

@fauust Your using exactly this template? https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/os/windows_agent_active/template_os_windows_agent_active.xml

What version of python? What OS are you on? And what's your locale? (it might be useful to know)

@fauust
Copy link
Author

fauust commented May 5, 2020

Hi @paalbra, yes this is the template I am using and here comes the information requested.

cat /etc/debian_version && uname -a && python -V && env | grep LANG                                    
10.3
Linux laptop 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
Python 2.7.16
LANGUAGE=en_US:en
LANG=en_US.UTF-8

@fauust
Copy link
Author

fauust commented Jun 11, 2021

Hi! FYI I can't reproduce this anymore on Zabbix 5.0.11 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants