omni-lchen / zabbix-cloudwatch

71 stars 61 forks source link

Error talking to server: a bytes-like object is required, not 'str' - python3 #57

Open marif1989 opened 4 years ago

marif1989 commented 4 years ago

I am using the python3. facing a many issues with python3 with this plugin. however i think i am very near to make this working.. I am facing below error...when i removed the proxy

./cron.ES.sh xxxxxxxxxx cssdev xxxxxxxxxxx xxxxxxxx xxxxxxxxxx ap-southeast-1 Error talking to server: a bytes-like object is required, not 'str'

if i keep the proxy I am getting below error...

Traceback (most recent call last): File "/usr/lib/zabbix/externalscripts/zabbixCloudWatch.py", line 394, in cw_data = getCloudWatchData(aws_account, aws_region, aws_service, dimensions) File "/usr/lib/zabbix/externalscripts/zabbixCloudWatch.py", line 181, in getCloudWatchData results = cw.get_metric_statistics(period, start_time, end_time, metric_name, namespace, statistics, dimensions) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/ec2/cloudwatch/init.py", line 239, in get_metric_statistics [('member', Datapoint)]) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 1170, in get_list response = self.make_request(action, params, path, verb) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 1116, in make_request return self._mexe(http_request) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 913, in _mexe self.is_secure) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 705, in get_http_connection return self.new_http_connection(host, port, is_secure) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 747, in new_http_connection connection = self.proxy_ssl(host, is_secure and 443 or 80) File "/var/lib/zabbix/my_app/env/lib64/python3.6/site-packages/boto/connection.py", line 796, in proxy_ssl sock.sendall("CONNECT %s HTTP/1.0\r\n" % host) TypeError: a bytes-like object is required, not 'str'

Could you please provide some hint to make it work?