Skip to content

Test environment for Intel Snap and Telegraf agents using Grafana and ElasticSearch

Notifications You must be signed in to change notification settings

alehandru/grafana

Repository files navigation

Grafana

Test environment for Intel Snap and agents using Grafana and ElasticSearch

Getting Started

The test enviroment depends on having a docker enviroment running. If you need to install docker on OSX you can learn from here https://docs.docker.com/docker-for-mac/install/

Building test enviroment

To build test enviroment run the following command:

docker-compose build

Running the test enviroment

To run the test enviroment run the following command:

docker-compose up

This command starts the following docker containers:

  • Snap container:

    • Runs Intel Snap Agent
  • Grafana container:

    • Runs the following services:
      • ElasticSearch
      • Grafana
      • Kibana
      • Ngix
      • Carbon
      • Graphite

Data flow

Each collector Snap agent sends metrics to ElasticSearch at http://grafana:9200. The data stored inside ElasticSearch is displayed using Grafana which connects to ElasticSearch at http://localhost:9200.

See data using Grafana dashboards

Open a browser and navigate to Grafana website http://localhost:3000. Login as user 'admin' with password 'admin'. Navigate to Data Sources, open each data source Snap/ and click Save and Test. Navigate to Dashboards, open Snap/ dashboards to see metrics generated by each agent.

NOTE: Please note that not all metrics generated by agents are displayed in dashboards.

Other usefull information

Log files are generated under grafana/supervisor directory.

Grafana:

  • Url: http://localhost:3000
  • Install directory: /www/data/grafana
  • Configuration: grafana/config.js
  • Setup script: grafana/add_data_sources.py
    • adds data sources
    • adds dashboards
  • Dashboard templates:
    • Snap - grafana/snap-metrics.json
      • grafana/-metrics.json

Elastic Search:

  • Install directory: /opt/elasticsearch

Graphite:

  • Install directory: /opt/graphite
  • Configuration: graphite/carbon.conf

Kibana

  • Install directory: /www/data/kibana
  • Configuration: kibana/carbon.conf

Ngix:

  • Configuration: nginx/nginx.conf

Intel Snap:

  • Install directory: /opt/snap
  • Configuration: snap/config.yaml

:

  • Install directory: /opt/
  • Configuration: /.conf

Elastic Search queries

In order to see data generated inside indices you can use the below queries. These commands can be executed from grafana_grafana_1 docker container.

NOTE: Please note that indices are created for each day. Update the date from indices name for the desired date.

Display all indices inside Elastic Search

curl -XGET 'localhost:9200/_cat/indices?v&pretty'

Display first 10 entries from index

curl -XPOST 'localhost:9200/-2017.06.16/_search?pretty' -d '
{
  "query": { "match_all": {} },
  "size": 10
}'

Display first 10 entries from Snap index.

curl -XPOST 'localhost:9200/snap-log-2017.06.16/_search?pretty' -d '
{
  "query": { "match_all": {} },
  "size": 10
}'

Display first 10 entries that corespond to metrics cpu

curl -XPOST 'localhost:9200/-2017.06.16/_search?pretty' -d '
{
  "query": { "match": { "measurement_name": "cpu" } },
  "size": 10
}'

Display first 10 entries metric that corespond to metrics cpu and for tag.path '/'

curl -XPOST 'localhost:9200/-2017.06.16/_search?pretty' -d '
{
  "query": {
    "bool": {
      "must": [
        { "match": { "measurement_name": "disk" } },
        { "match": { "tag.path": "/" } }
      ]
    }
  },
  "size": 10
}'

Read more about Elastic Search queries [https://www.elastic.co/guide/en/elasticsearch/reference/1.4/query-dsl-match-query.html]

About

Test environment for Intel Snap and Telegraf agents using Grafana and ElasticSearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published