trevorndodds / elasticsearch-metrics

102 stars 99 forks source link

is not support elasticsearch 7.x+ with ssl ? #42

Closed zqc0512 closed 5 years ago

zqc0512 commented 5 years ago

with es7.1.1 the basic auth is free i use ssl with elasticsearch but this can't run with ssl thanks. is not support elasticsearch 7.1.1 with ssl ? @trevorndodds

zqc0512 commented 5 years ago

the error is

Error3:  HTTP Error 400: Bad Request
Error3:  HTTP Error 400: Bad Request
Error3:  HTTP Error 400: Bad Request
Error3:  HTTP Error 400: Bad Request
Error3:  HTTP Error 400: Bad Request

def post_data(data): utc_datetime = datetime.datetime.utcnow() url_parameters = {'cluster': elasticMonitoringCluster, 'index': elasticIndex, 'index_period': utc_datetime.strftime("%Y.%m.%d"), } url = "%(cluster)s/%(index)s-%(index_period)s/message" % url_parameters headers = {'content-type': 'application/json'} try: req = urllib2.Request(url, headers=headers, data=json.dumps(data)) if write_es_security_enable: password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() password_mgr.add_password(None, url, write_username, write_password) handler = urllib2.HTTPBasicAuthHandler(password_mgr) opener = urllib2.build_opener(handler) urllib2.install_opener(opener) response = urllib2.urlopen(req) else: response = urllib2.urlopen(req) except Exception as e: print "Error3: {0}".format(str(e))

ghost commented 5 years ago

Same error after upgarde to 7.3 Error: HTTP Error 400: Bad Request Error: HTTP Error 400: Bad Request Error: HTTP Error 400: Bad Request Error: HTTP Error 400: Bad Request

trevorndodds commented 5 years ago

No SSL support, you can add it...

zqc0512 commented 5 years ago

how can do about it?

SapphyrKnight commented 2 years ago

I would also love to know how to modify this to use SSL. Python scripts are well outside of my realm of expertise.