Infinity datasource - json query error internal server error 500

Hello guys,
Im trying to pull metrics from hpe imc with rest api into grafana
Im using infinty datasource, but im getting a query error when sending http request.
I added a header to the request with basic authentication,
Header name is “Authorization:” and Header value is “Basic username:password” in base64 encoding
screens attached
if someone can help troubleshooting this error


Hover on the topnleft exclamation and see what it says and post back?

Here is the message error

1 Like

Can you use curl to see if your api query works? Just to eliminate grafana and infinity as the source of the issue?

I am not sure but are you sure you can use localhost as GRAFANA is a remote app and you need to use your external server name or public IP

Yes the api query works

Not sure i did understand your question but im using different ports between grafana and hpe imc
3000 for grafana and 8080 for hpe

the OSS version can be installed locally on almost any OS including raspberry pi

then why are you getting 500 error?

The ports are not the issue it is the url address. If you are using GRAFANA on a local device then all files etc must be in the local webserver thefolder. Wherever localhost points top is where the files must be kept other 500 error.

I was using the web browser to view api request and it worked, i tried curl and this is the result i get
i used -u but still it shows unauthorized access

I think its worth mentionning that in grafana when i dont add authentification header i get response code from server : 401. Error message : 401 Unauthorized

and when i add the header :
Header name is “Authorization:” and Header value is “Basic username:password” in base64 encoding i get this 500 error

It worked when you used web browser? Just simply putting that url in a browser? Without user name and password prompt?

No, it does require authentification.
but when using curl with -u switch why im getting unauthorized access error?

I found that AuthType 4 is used in authentication to the hpe imc server ( Digest Auth ) now i can get the response with curl, but not sure if infinity datasource supports Digest Auth, or is there anyway to add digest parameters with the http request?

Maybe ask here

How about adding an Authorization header and then add that hash or user:password?

The problem is for each authentication the server generates a nonce, nonce count and cnonce that should be included in the response.

What we have here :

qop = “auth”

HA1 = MD5(username:realm:password)

HA2 = MD5(method:digestURI)

the response that should be sent to the server:

response = MD5(HA1:nonce:nonceCount:cnonce:qop:HA2)