Giter Site home page Giter Site logo

saltstack-meetup-2018-06-12's Introduction

SaltStack Meetup Demo (06/12/2018)

The Problem

Understanding the beacon system and how they can be useful...

The beacon system continually monitors system processes and will send an event to the event bus when triggered. Beacons leverage the Salt reactor system to make changes when beacon events occur. Some examples of processes that can be monitored are...

  • file system changes
  • system load
  • service status
  • shell activity, such as user login
  • network and disk usage

for a full listing of beacon modules check here: beacon modules

Configuring Beacons

Salt beacons do not require any changes to the system process that is being monitored, everything is configured using Salt.

Beacons are typically enabled by placing a beacons: top level block in the minion configuration file:

beacons:
  inotify:
    /etc/httpd/conf.d: {}
    /opt: {}

The beacon system, like many others in Salt, can also be configured via the minion pillar, grains, or local config file.

  • The inotify beacon only works on OSes that have inotify kernel support. Currently this excludes FreeBSD, Mac OS X, and Windows.

Beacon Monitoring Interval

Beacons monitor on a 1-second interval by default. To set a different interval, provide an interval argument to a beacon. Here is an example of a beacon that runs on 5- and 10-second intervals:

beacons:
  inotify:
    /etc/httpd/conf.d: {}
    /opt: {}
    interval: 5
  load:
    1m:
      - 0.0
      - 2.0
    5m:
      - 0.0
      - 1.5
    15m:
      - 0.1
      - 1.0
    interval: 10

Avoiding Event Loops

It is important to carefully consider the possibility of creating a loop between a reactor and a beacon. For example, one might set up a beacon which monitors whether a file is read which in turn fires a reactor to run a state which in turn reads the file and re-fires the beacon.

To avoid these types of scenarios, the disable_during_state_run argument may be set. If a state run is in progress, the beacon will not be run on its regular interval until the minion detects that the state run has completed, at which point the normal beacon interval will resume.

beacons:
  inotify:
    - files:
        /etc/important_file: {}
    - disable_during_state_run: True

Solutions

Example 1

Example 2

DOJO

Dig into it...

  • write a custom beacon plugin ?
  • your ideas?

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.