Page 1 of 1

Grafana integration question

Posted: Wed Jan 25, 2017 4:01 pm
by benhank
Howdi guys,

I have a project that involves using Grafana with elasticsearch. I seem to have run into a hiccup.
Here is a link to Grafana's docs on the topichttp://docs.grafana.org/datasources/elasticsearch/.
Its reads:

Code: Select all

Direct access

If you select direct access you must update your Elasticsearch configuration to allow other domains to access Elasticsearch from the browser. You do this by specifying these to options in your elasticsearch.yml config file.

http.cors.enabled: true
http.cors.allow-origin: "*"
but I cant find those lines in

Code: Select all

/usr/local/nagioslogserver/elasticsearch/config/elasticsearch.yml
Is there something im missing?
Thanks in advance!

Re: Grafana integration question

Posted: Wed Jan 25, 2017 4:11 pm
by mcapra
Looks like it uses the Elasticsearch HTTP API to grab the data. I would try editing the following line:

Code: Select all

http.host: "localhost"
And changing it to:

Code: Select all

http.host: "0.0.0.0"
And restarting your Elasticsearch service. Though, you might want to change your firewall settings to only allow inbound traffic on 9200 from your Grafana box. Otherwise, any machine on the subnet would be able to write to or read from your Elasticsearch cluster.

Re: Grafana integration question

Posted: Wed Jan 25, 2017 4:30 pm
by benhank
ill give it a whirl and thanks!

Re: Grafana integration question

Posted: Wed Jan 25, 2017 4:33 pm
by dwhitfield
Let us know how it goes!

Re: Grafana integration question

Posted: Wed Jan 25, 2017 4:41 pm
by benhank
sorry about this, that worked now it is asking me for an "instance name", where would i find that?

Re: Grafana integration question

Posted: Wed Jan 25, 2017 4:52 pm
by mcapra
Good question. Is this NLS cluster behind a load balancer of some sort? Are you giving Grafana the address of a specific NLS node (assuming multiples exist)?

You could try giving it the cluster id or the specific instance id of the host you're connecting to. Here's mine:
2017_01_25_15_51_59_Cluster_Status_Nagios_Log_Server.png
2017_01_25_15_52_24_Instance_Status_Nagios_Log_Server.png
Though i'm not sure why it would ever need a cluster/node ID to ask the HTTP API for things.

Re: Grafana integration question

Posted: Thu Jan 26, 2017 10:46 am
by benhank
It's working!

here is the index name they want:
Capture.PNG

Re: Grafana integration question

Posted: Thu Jan 26, 2017 10:58 am
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!

Re: Grafana integration question

Posted: Thu Jan 26, 2017 11:00 am
by benhank
yup and thanks!

Re: Grafana integration question

Posted: Thu Jan 26, 2017 11:01 am
by dwhitfield
You're welcome!