Answer the question
In order to leave comments, you need to log in
How to pass the correct string to the input to the Python script or correctly process what is passed in the script?
Comrades help out, the situation is as follows:
I am writing a Python 3 script to integrate Zabbix 2.2 and our local ServiceDesk system.
I configure Zabbix to work with an external script by analogy with this instruction: www.pagerduty.com/docs/guides/zabbix-integration-guide
The problem is that the input to the script instead of Russian characters comes with something similar to a unicode string, here:
['/etc/zabbix/alert.d//script.py',
'[email protected]',
'trigger',
'name:No ping availability\nid:100100000013878\nstatus:PROBLEM\nhostname:sms\nip:192.168.47.122\nvalue:1\nevent_id:100100001782560\nseverity:High\n
inventoryname:Server for send SMS\n
inrussia:\udcd0\udcbf\udcd1\udc80\udcd0\udcbe\udcd1\udc81\udcd1\udc82\udcd0\udcbe\udcd0\udcb5 \udcd1\udc81\udcd0\udcbb\udcd0\udcbe\udcd0\udcb2\udcd0\udcbe \udcd0\udcbd\udcd0\udcb0 \udcd1\udc80\udcd1\udc83\udcd1\udc81\udcd1\udc81\udcd0\udcba\udcd0\udcbe\udcd0\udcbc.']
inrussia:простое слово на русском.
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question