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

Basic authentication #55

Closed
thavini opened this issue Sep 22, 2016 · 4 comments
Closed

Basic authentication #55

thavini opened this issue Sep 22, 2016 · 4 comments
Assignees
Labels
Projects

Comments

@thavini
Copy link

thavini commented Sep 22, 2016

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

@thavini
Copy link
Author

thavini commented Sep 22, 2016

I got it.

When i am sure it works i will post the solution here.

ableev pushed a commit that referenced this issue Feb 25, 2017
ableev pushed a commit that referenced this issue Feb 25, 2017
…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
@ableev ableev self-assigned this Feb 25, 2017
@ableev ableev added the feature label Feb 25, 2017
@ableev ableev added this to In dev, testing in ZbxTg Sep 11, 2017
@ikzelf
Copy link

ikzelf commented May 7, 2018

I just found out about this issue/feature request. I would be more than happy to help testing this, as you guessed, I got the same issue .....

@ableev
Copy link
Owner

ableev commented May 7, 2018

@ikzelf it was merged to master some time ago

@ikzelf
Copy link

ikzelf commented May 7, 2018

@ableev thanks .... it seems to work too. Why not close this issue?

@ableev ableev closed this as completed Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
ZbxTg
In dev, testing
Development

No branches or pull requests

3 participants