Giter VIP home page Giter VIP logo

ansible-role-sensu's Introduction

#######################################################################################################

❗ DEPRECATION ❗

This repository and the role associated are deprecated in favor of the Manala Sensu go role

You can find it in the Manala Ansible Collection. You will find informations on its usage on the collection repository

#######################################################################################################

Ansible Role: Sensu Build Status

Report issues and send Pull Requests in the main Ansible Role repository

This role will deal with the setup of Sensu.

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

This role is made to work with the sensu official debian packages, available on the sensu debian repository. Please use the manala.apt role to handle it properly.

manala_apt_preferences:
  - sensu@sensu

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.sensu

Using ansible galaxy requirements file:

- src: manala.sensu

Role Handlers

Name Type Description
sensu restart Service Restart all sensu services
sensu-api restart Service Restart sensu api
sensu-client restart Service Restart sensu client
sensu-server restart Service Restart sensu server

Role Variables

Name Default Type Description
manala_sensu_install_packages ~ Array Dependency packages to install
manala_sensu_install_packages_default ['sensu'] Array Default dependency packages to install
manala_sensu_config_template 'config/empty.j2' String Configuration base template path
manala_sensu_config [] Array Configuration directives
manala_sensu_gems [] Array Gems to install (http://sensu-plugins.io/)
manala_sensu_configs_template 'configs/default.j2' String Additional configurations base template path
manala_sensu_configs [] Array Additional configurations directives
manala_sensu_configs_exclusive false Array Additional configurations exclusivity
`manala_sensu_configs_user 'sensu' String Name of the user that should own config files
`manala_sensu_configs_group 'sensu' String Name of the group that should own config files
`manala_sensu_configs_mode 0644 Octal Additional configurations files mode
manala_sensu_checks [] Array Checks directives
manala_sensu_services [] Array Enable and start sensu services (sensu-server, sensu-client, sensu-server)

Configuration example

Sensu server

manala_sensu_services:
  - sensu-server
  - sensu-api

manala_sensu_gems:
  - name: sensu-plugins-slack
    version: 1.0.0

manala_sensu_configs:
  - file: transport.json
    config:
      transport:
        name: redis
  - file: redis_config.json
    config:
      redis:
        host: "{{ ansible_eth0.ipv4.address }}"
        port: 6379
  - file: api.json
    config:
      api:
        host:     "{{ ansible_eth0.ipv4.address }}"
        port:     4567
        user:     admin
        password: password
  - file: handler_checks.json
    config:
      handlers:
        checks:
          type:     set
          handlers: [slack]
  - file: handler_slack.json
    config:
      handlers:
        slack:
          type: pipe
          command: handler-slack.rb
          severites: [critical, unknown]
      slack:
        webhook_url: https://hooks.slack.com/services/...
        bot_name: sensu

Sensu client

manala_sensu_services:
  - sensu-client

manala_sensu_config:
  EMBEDDED_RUBY: true
  LOG_LEVEL: warn

manala_sensu_configs_exclusive: true

manala_sensu_configs:
  - file: transport.json
    config:
      transport:
        name: redis
  - file: redis_config.json
    config:
      redis:
        host: sensu.example.local
        port: 6379
  - file: client.json
    config:
      client:
        name:          "{{ ansible_fqdn }}"
        address:       "{{ ansible_fqdn }}"
        subscriptions: "{{ ['production', ansible_hostname] + group_names }}"
        keepalive:
          handler: checks
          thresholds:
            warning:  300
            critical: 600

manala_sensu_gems:
  - name: sensu-plugins-process-checks
    version: 1.0.0
  - name: sensu-plugins-disk-checks
    version: 2.0.1

manala_sensu_checks:
  - name: sshd_running
    command: check-process.rb -p sshd
    handlers: checks
    standalone: true
    interval: 300
    occurrences: 2
    refresh: 3600
  - name: cron_running
    command: check-process.rb -p cron
    handlers: checks
    standalone: true
    interval: 300
    occurrences: 2
    refresh: 3600
  - name: disk_available
    command: check-disk-usage.rb -w 90 -c 95 -W 90 -K 95
    handlers: checks
    standalone: true
    interval: 300
    occurrences: 2
    refresh: 3600

Example playbook

- hosts: sensu
  roles:
    - { role: manala.sensu }

Licence

MIT

Author information

Manala (http://www.manala.io/)

ansible-role-sensu's People

Contributors

greedybro avatar nervo avatar

Watchers

 avatar  avatar  avatar  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.