Not able create ntopng datasource in grafana

Hi All,

I have installed ntopng datasource in grafana and after giving the ntop url in Http settings and then I clicked Save & Test but I am getting unknown error.

Below is the screenshot for reference,

Note:- The Grafana is running with HTTPS protocol and the ntop is running with HTTP.

I have also tried in the demo machine where grafana is running with HTTP and I did the same configuration and tested that the datasource was updated and its working fine.

Please kindly share any thoughts and it would be very helpful.

Thanks,
Ganeshbabu R

Hi,

Have you tried using access proxy instead of direct?

Marcus

Yes @mefraimsson I tried but i am getting the below exception,

I couldn’t find any errors in log file of grafana.

Regards,
Ganeshbabu R

Seems to me that grafana cannot access that url.

Marcus

This is actually one of the rare cases where access should be set to direct. From the docs for the plugin:

The HTTP url must point to a running ntopng instance, to the endpoint /lua/modules/grafana. The Access method must be set to Direct

Does the url work from your computer? Direct means direct from your browser (and not proxied via the Grafana server).

And which version of ntopng are you running?

@daniellee

I have set the access as “direct” and I am getting below response,

Yes I can able to access in browser and below is the screenshot for reference,

ntopng Community Edition v.3.3.180206
Grafana version 4.4.3

Grafana is running with https and ntop is running on http. Shouldn’t be a problem with the http protocol?

Let me know your thoughts.

Regards,
Ganeshbabu R

Hey!

I have the same problem but elsewhere. My ntopng is run via https and grafana via http.
And im unable to add the ntopng datasource to grafana…

Would it be better to just turn off https from ntopng and just ignore the fact that it dont work? :stuck_out_tongue:

btw @ganeshbaburamamoorth are you sure that you are using / in the end of /lua/modules/grafana/ ?

br
Brew8it

Yes @brew8it I am using it and I followed this documentation

I have one demo environment where my grafana is running with http and I can able to add datasource to that and it was working fine.

Regards,
Ganeshbabu R

@ganeshbaburamamoorth and @brew8it can you see what the actual error is?

Most likely by looking at the console or network tab in the Chrome Dev Tools but if there is nothing there you can check the Grafana server logs as well.

@daniellee
Below is the response I got in the console tab.

Mixed Content: The page at 'https://xxxxx.com:3001/datasources/edit/162' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://172.21.86.30:3000/lua/modules/grafana/'. This request has been blocked; the content must be served over HTTPS.

Please kindly check and let me know your thoughts.

Thanks
Ganeshbabu R

This is maybe a question for the ntop guys and why you have to use direct mode for their plugin. This type of issue is why proxy mode exists in Grafana.

It looks like you will have to use http for Grafana as well or use ntopng with https: https://github.com/ntop/ntopng/blob/dev/doc/README.SSL or use a proxy.

Hi

This is the second time I have tried to get ntopng working (tried over 6 months ago)
Downloading the plugin from the grafana site results in
grafana-cli plugins install ntop-ntopng-datasource

installing ntop-ntopng-datasource @ 1.0.0

from url: https://grafana.com/api/plugins/ntop-ntopng-datasource/versions/1.0.0/download

into: /var/lib/grafana/plugins

Failed downloading. Will retry once.

Failed downloading. Will retry once.

Error: ✗ Corrupt http response from source. Please try again.

Downloading the zip file in accordance with the instructions on the grafana website, and attempting to create datasource results in
Gate way error
or
Red square with no information

when trying all the options in this thread.

In addition there appears to be no direct option available in grafana 5.2.2, just Server or Browser.

If anybody has got this working, please can they post the procedure here.

Thanks

Hi

There is either a documentation error on the grafana page,
http://localhost:3001/lua/modules/grafana, or something is not correct in the ntopng out of the box installation,
There is no server on Port 3001, there is on Port 3000 (netstat is your friend)
I now have an http access to ntopng, on my http based grafana, and I am seeing metrics.

Hi
As an alternative, ntopng can feed metrics to influxdb, and grafana can read from infuxdb, which is the way I do it generally, so this may be a better option.
Also looking at the metrics, there seems to be a lot more available, or they have been marshalled in a different way to the ntopng data source.