Giter Club home page Giter Club logo

ansible-prometheus's Introduction

Ansible Role: prometheus Build Status

An Ansible role that installs Prometheus Monitoring server on Ubuntu-based machines with systemd.

Requirements

All needed packages will be installed with this role. Minimal Ansible version - 2.0.

Role Variables

Available main variables are listed below, along with default values:

prometheus_version: 2.1

prometheus_global_scrape_interval: 15s
prometheus_global_evaluation_interval: 15s
prometheus_global_scrape_timeout: 10s
prometheus_self_scrape_interval: "{{ prometheus_global_scrape_interval }}"
prometheus_self_evaluation_interval: "{{ prometheus_global_scrape_interval }}"

prometheus_root_dir: /opt/prometheus
prometheus_config_dir: /etc/prometheus
prometheus_pid_path: /var/run/prometheus.pid
prometheus_db_dir: /var/lib/prometheus

prometheus_web_listen_address: ":9090"
prometheus_alertmanager_url: 'localhost:9093'

prometheus_config_flags:
  'config.file': '{{ prometheus_config_dir }}/prometheus.yml'
  'storage.local.path': '{{ prometheus_db_dir }}'
  'web.listen-address': '{{ prometheus_web_listen_address }}'
  'alertmanager.url': '{{ prometheus_alertmanager_url }}'

All variables you can see here.

Dependencies

This role doesn't have dependencies.

Example Playbook

- hosts: monitoring
  roles:
    - { role: UnderGreen.prometheus }

You should create another config parts of main file inside {{ playbook_dir }}/files/config_parts.
I use Ansible assembly and config parts should have alphabethical order. For example 2-static_sd.yml:

scrape_configs:
  - job_name: "files_sd"
    scrape_interval: 15s
    file_sd_configs:
      - files:
        - '/etc/prometheus/tgroups/*.json'
        - '/etc/prometheus/tgroups/*.yml'
        - '/etc/prometheus/tgroups/*.yaml'
        refresh_interval: '5m'

Example 03-alertmanager.yml:

alerting:
  alertmanagers:
  - scheme: http
    static_configs:
      - targets:
        - '127.0.0.1:9093'

License

GPLv2

ansible-prometheus's People

Watchers

 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.