Code Monkey home page Code Monkey logo

ansible-role-metricbeats's Introduction

Metricbeat Role

License Build Status Build Status Galaxy Ansible Ansible

Summary

This role:

  • installs metricbeat on Ubuntu, CentOS
  • copies prepared configuration file (log path, connect to elasticsearch etc.)

Role tasks

  • Prepare server (add elastic repo)
  • Install metricbeat
  • [Optional] Copy configuration file
  • [Optional] Enable modules

Requirements

  • Minimal Version of the ansible for installation: 2.9
  • Supported OS:
    • CentOS
      • 7,8
    • Ubuntu
      • 16.04, 18.04
    • Debian
      • 8, 9

Role Variables


You can override any variable below by setting "variable: value" in playbook.

  • elastic_gpg_key GPG-key from elasticsearch repository. Default value is https://artifacts.elastic.co/GPG-KEY-elasticsearch
  • elastic_gpg_key_redhat GPG-key from elasticsearch repository. Default value is https://packages.elastic.co/GPG-KEY-elasticsearch
  • metricbeat_config Custom config for metricbeat
  • metricbeat_modules Specify which modules will be enabled. By default only system module enabled

Advanced config parameters:

  • metricbeat_service_name Name of nssm\init script, which manages filebeat service

Dependencies


Nothing

Example Playbook

Installing Metricbeat 7.x version:

- name: Install metricbeat
  hosts: all
  roles:
    - role: ansible-role-metricbeat

Installing Metricbeat 7.x version with enabled system and jolokia modules:

- name: Install metricbeat
  hosts: all
  roles:
    - role: ansible-role-metricbeat
  vars:
    metricbeat_modules:
      - system
      - jolokia

Installing Metricbeat 7.x version with custom config:

- name: Install metricbeat
  hosts: all
  roles:
    - role: ansible-role-metricbeat
  vars:
    metricbeat_config: {
      "metricbeat.config.modules": {
        "path": '${path.config}/modules.d/*.yml',
        "reload.enabled": false
        },
       "output.elasticsearch": {
         "hosts": ["localhost:9200"],
         "#username": "elastic",
         "#password": "changeme"
       },
       "#output.logstash": {
         "#hosts": ["localhost:5044"]
       }
      }

Installing Metricbeat 7.x version with custom jolokia module:

- name: Install metricbeat
  hosts: all
  roles:
    - role: ansible-role-metricbeat
  vars:
    metricbeat_modules:
      - system
      - jolokia
    module_config:
      - module: jolokia
        metricsets: ["jmx"]
        period: 10s
        hosts: ["localhost:9999"]
        namespace: "metrics"
        path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
        http_method: "POST"
        jmx.mappings:
        - mbean: 'java.lang:type=Memory'
          attributes:
            - attr: HeapMemoryUsage
              field: memory.heap_usage
            - attr: NonHeapMemoryUsage
              field: memory.non_heap_usage

License

Apache

Author Information

authors:

ansible-role-metricbeats's People

Watchers

James Cloos avatar Max avatar

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.