Giter Site home page Giter Site logo

basic-monitoring-lab's Introduction

Basic Monitoring

Lab: Basic monitoring using Grafana, Graphite and Collectd with Docker containers


Setting up the environment

  • Clone the repository to get the docker-compose file
$ git clone https://github.com/leonjalfon1/basic-monitoring-lab.git
$ cd basic-monitoring-lab
  • Set up the environment by run:
$ docker-compose up -d

Exploring Grafana

  • Browse to the Grafana portal:
$ http://localhost:3000
  • Login using the credentials below:
username: admin
password: admin
  • You will be asked for set a new password, set the password below:
password: admin
  • Explore Grafana on your own

Exploring Graphite

  • Browse to the Graphite portal:
$ http://localhost:5000
  • Login using the credentials below:
username: root
password: root
  • Explore Graphite on your own

Exploring the application

  • Browse to the application page:
$ http://localhost:80

Configure collectd in the application server

  • Move to the application container terminal:
$ docker exec -it app /bin/bash
  • Install collectd tool:
$ apt-get update
$ apt-get install -y collectd collectd-utils
  • Install vim tool:
$ apt-get install -y vim
  • Configure collectd to send metrics to Graphite:
$ vim /etc/collectd/collectd.conf
  • Enable the following plugins:
LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin ping
LoadPlugin write_graphite
  • Configure the following plugins as below:
<Plugin ping>
        Host graphite
#       Host "host.baz.qux"
        Interval 1.0
        Timeout 0.9
        TTL 255
#       SourceAddress "1.2.3.4"
#       Device "eth0"
        MaxMissed -1
</Plugin>

<Plugin write_graphite>
        <Node "graphite">
                Host graphite
                Port "2003"
                Protocol "tcp"
                LogSendErrors true
#                Prefix "collectd"
#               Postfix "collectd"
                StoreRates true
                AlwaysAppendDS false
                EscapeCharacter "_"
        </Node>
</Plugin>
  • For changes to take affect, please restart collectd service :
$ /etc/init.d/collectd restart
  • Browse to Graphite and look for the new metrics (under :
$ http://localhost:5000/

Add a Data Source and Create a Grafana Dashboard

  • Click Create data source in the main dashboard:

Image 1

  • Fill the form as follows:
Name: my-graphite-server
Type: Graphite
URL: http://graphite:8080
Access: Server (Default)
Version: <Select the newest available>

Image 2

  • Click New dashboard to create and customize a new panel:

Image 3

  • Select "Graph":

Image 4

  • Edit the graph by click "Edit":

Image 5

  • Configure the "General" section with the below:

Image 6

  • Configure the "Metrics" section with the below:

Image 7

  • Configure the "Axes" section with the below:

Image 8

  • Save the dashboard:

Image 9

  • You will be asked for the dashboard name and folder, set the following:
New name: my-first-dashboard
Folder: General

Image 10

  • Good Job! You already know all the basics to start monitoring, now it only remains to explore on your own :)

Image 11

basic-monitoring-lab's People

Contributors

leonjalfon1 avatar

Watchers

 avatar  avatar

Forkers

dudilv dudi938

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.