Grafana integration question

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Grafana integration question

Post 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!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Grafana integration question

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Grafana integration question

Post by benhank »

ill give it a whirl and thanks!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Grafana integration question

Post by dwhitfield »

Let us know how it goes!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Grafana integration question

Post by benhank »

sorry about this, that worked now it is asking me for an "instance name", where would i find that?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Grafana integration question

Post 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.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Grafana integration question

Post by benhank »

It's working!

here is the index name they want:
Capture.PNG
You do not have the required permissions to view the files attached to this post.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Grafana integration question

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Grafana integration question

Post by benhank »

yup and thanks!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Grafana integration question

Post by dwhitfield »

You're welcome!
Locked