You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have basic authentication for our zabbix. I really want to use this script because it is really awesome. And it works on my own home installed zabbix server but not at the office.
The script does not allow to use basic authentication at this moment.
I managed to change the .bash script:
Login: ${CURL} --cookie-jar ${TMP_COOKIE} --request --basic -u ${ZBX_API_USER}:${ZBX_API_PASS} ${ZBX_SERVER}/
Image: ${CURL} --cookie ${TMP_COOKIE} --basic -u ${ZBX_API_USER}:${ZBX_API_PASS} --globoff "${URL}" -o ${IMG_NAME}
This works for me and i can download a nice graph (what i expected) when i use the command manually.
But i am not known with Python. the following error occurs when executing a test. ./zbxtg.py "<USERNAME>" "Test Titel" "Test Bericht" --debug Traceback (most recent call last): File "./zbxtg.py", line 458, in <module> main() File "./zbxtg.py", line 344, in main print_message(tg.get_me()) File "./zbxtg.py", line 39, in get_me me = self.http_get(url) File "./zbxtg.py", line 20, in http_get res = requests.get(url, proxies=self.proxies) File "/usr/lib/python2.6/site-packages/requests/api.py", line 68, in get return request('get', url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 370, in send timeout=timeout File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen body=body, headers=headers) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request self._validate_conn(conn) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 784, in _validate_conn conn.connect() File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connection.py", line 252, in connect ssl_version=resolved_ssl_version) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 296, in ssl_wrap_socket cnx.set_tlsext_host_name(server_hostname) AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
When executing bash script i get. ./zbxtg.sh "<USERNAME>" "Test Titel" "Test Bericht" --debug {"ok":true,"result":[]}
This is a bit strange. This is the response from Telegram i geus?
How can i handle with this?
Best regards,
Vincent
The text was updated successfully, but these errors were encountered:
…ctive bot: #53; ability to send several items in one graph: #66; removed message editing from #37; new option to send one message instead of two: #47; small fixes, codeformatting, etc
Hello,
We have basic authentication for our zabbix. I really want to use this script because it is really awesome. And it works on my own home installed zabbix server but not at the office.
The script does not allow to use basic authentication at this moment.
I managed to change the .bash script:
Login:
${CURL} --cookie-jar ${TMP_COOKIE} --request --basic -u ${ZBX_API_USER}:${ZBX_API_PASS} ${ZBX_SERVER}/
Image:
${CURL} --cookie ${TMP_COOKIE} --basic -u ${ZBX_API_USER}:${ZBX_API_PASS} --globoff "${URL}" -o ${IMG_NAME}
This works for me and i can download a nice graph (what i expected) when i use the command manually.
But i am not known with Python. the following error occurs when executing a test.
./zbxtg.py "<USERNAME>" "Test Titel" "Test Bericht" --debug Traceback (most recent call last): File "./zbxtg.py", line 458, in <module> main() File "./zbxtg.py", line 344, in main print_message(tg.get_me()) File "./zbxtg.py", line 39, in get_me me = self.http_get(url) File "./zbxtg.py", line 20, in http_get res = requests.get(url, proxies=self.proxies) File "/usr/lib/python2.6/site-packages/requests/api.py", line 68, in get return request('get', url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 370, in send timeout=timeout File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen body=body, headers=headers) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request self._validate_conn(conn) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py", line 784, in _validate_conn conn.connect() File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/connection.py", line 252, in connect ssl_version=resolved_ssl_version) File "/usr/lib/python2.6/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 296, in ssl_wrap_socket cnx.set_tlsext_host_name(server_hostname) AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
When executing bash script i get.
./zbxtg.sh "<USERNAME>" "Test Titel" "Test Bericht" --debug {"ok":true,"result":[]}
This is a bit strange. This is the response from Telegram i geus?
How can i handle with this?
Best regards,
Vincent
The text was updated successfully, but these errors were encountered: