stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Using with grafana server https self signed #119

Closed aermike closed 1 year ago

aermike commented 4 years ago

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' }

stephenyeargin commented 4 years ago

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.

aermike commented 4 years ago

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 commented 4 years ago

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

stephenyeargin commented 4 years ago

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

aermike commented 4 years ago

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

stephenyeargin commented 4 years ago

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
aermike commented 4 years ago

I will try and send you an message thank you

aermike commented 4 years ago

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