hubot-grafana icon indicating copy to clipboard operation
hubot-grafana copied to clipboard

Using with grafana server https self signed

Open aermike opened this issue 6 years ago • 8 comments

When I intend to use with https grafana server(self signed) I experiment this error:

GMT+0300 (EEST)] ERROR { Error: self signed certificate at TLSSocket. (_tls_wrap.js:1105:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:639:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38) code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }

aermike avatar Sep 30 '19 07:09 aermike

This looks like it may be related to #51. See if you can set export NODE_TLS_REJECT_UNAUTHORIZED=0 in your ~Grafana~ Hubot config to tell the lower-level request library to accept your self-signed certificate.

stephenyeargin avatar Sep 30 '19 14:09 stephenyeargin

I added in .env file But....must say, i intend to use hubot-grafana with grafana server included in noc-project https://getnoc.com/ In standard install worked But this i think is custom install and talk with noc-project support Thanks for your help for now If i resolve i write to you

aermike avatar Oct 01 '19 10:10 aermike

received that "grafana will work only to users, who is authorized in noc. or you can supply auth headers in basic auth with your request from bot" can you tell me how resolve that? Thank you

aermike avatar Oct 01 '19 10:10 aermike

This package requires an API key rather than Basic Auth (which would be their username and password). If that product doesn't let you generate an API key for a particular user, it may not work with hubot-grafana.

https://github.com/stephenyeargin/hubot-grafana/blob/8f44a657bad5b59e2e1ee953888d59c349b1d235/src/grafana.coffee#L438-L439

stephenyeargin avatar Oct 01 '19 14:10 stephenyeargin

it's possible to modify auth to an user admin with passw admin?

aermike avatar Oct 01 '19 15:10 aermike

You may be able to specify it in the HUBOT_GRAFANA_HOST environment variable, per their documentation.

HUBOT_GRAFANA_HOST=https://<someusername>:<somepassword>@myserver.example.com

stephenyeargin avatar Oct 01 '19 15:10 stephenyeargin

I will try and send you an message thank you

aermike avatar Oct 01 '19 15:10 aermike

Hi Not worked, because software has own auth module, which not suport api

aermike avatar Oct 22 '19 08:10 aermike