Coder Social home page Coder Social logo

vagrant-flapjack's Introduction

Flapjack Flapjack

Build Status

Flapjack is a flexible monitoring notification routing system that handles:

  • Alert routing (determining who should receive alerts based on interest, time of day, scheduled maintenance, etc)
  • Alert summarisation (with per-user, per media summary thresholds)
  • Your standard operational tasks (setting scheduled maintenance, acknowledgements, etc)

Flapjack will be immediately useful to you if:

  • You want to identify failures faster by rolling up your alerts across multiple monitoring systems.
  • You monitor infrastructures that have multiple teams responsible for keeping them up.
  • Your monitoring infrastructure is multitenant, and each customer has a bespoke alerting strategy.
  • You want to dip your toe in the water and try alternative check execution engines like Sensu, Icinga, or cron in parallel to Nagios.

Try it out with the Quickstart Guide

The Quickstart guide will help you get Flapjack up and running in a VM locally using Vagrant and VirtualBox.

The technical low-down

Flapjack provides a scalable method for dealing with events representing changes in system state (OK -> WARNING -> CRITICAL transitions) and alerting appropriate people as necessary.

At its core, Flapjack processes events received from external check execution engines, such as Nagios. Nagios provides a 'perfdata' event output channel, which writes to a named pipe. flapjack-nagios-receiver then reads from this named pipe, converts each line to JSON and adds them to the events queue.

Flapjack sits downstream of check execution engines (like Nagios, Sensu, Icinga, or cron), processing events to determine:

  • if a problem has been detected
  • who should know about the problem
  • how they should be told

Additional check engines can be supported by adding additional receiver processes similar to the nagios receiver.

Installing

NB: v2 packages will be ready soon -- for the moment these instructions will not work

Ubuntu Precise 64 (12.04):

Tell apt to trust the Flapjack package signing key:

gpg --keyserver keys.gnupg.net --recv-keys 803709B6
gpg -a --export 803709B6 | sudo apt-key add -

Add the Flapjack Debian repository to your Apt sources:

echo "deb http://packages.flapjack.io/deb/v2 precise main" | sudo tee /etc/apt/sources.list.d/flapjack.list

Install the latest Flapjack package:

sudo apt-get update
sudo apt-get install flapjack

Alternatively, download the deb and install using sudo dpkg -i <filename>

The Flapjack package is an Omnibus package and as such contains most dependencies under /opt/flapjack, including Redis.

Installing the package will start Redis (non standard port) and Flapjack. You should now be able to access the Flapjack Web UI at:

http://localhost:3080/

And consume the REST API at:

http://localhost:3081/

N.B. The Redis installed by Flapjack runs on a non-standard port (6380), so it doesn't conflict with other Redis instances you may already have installed.

Other OSes:

Currently we only make a package for Ubuntu Precise (amd64). If you feel comfortable getting a ruby environment going on your preferred OS, then you can also just install Flapjack from rubygems.org:

gem install flapjack

Using a tool like rbenv or rvm is recommended to keep your Ruby applications from intefering with one another.

Alternatively, you can add support for your OS of choice to omnibus-flapjack and build a native package. Pull requests welcome, and we'll help you make this happen!

You'll also need Redis >= 2.6.12.

Configuring

Have a look at the default config file and modify things as required. The package installer copies this to /etc/flapjack/flapjack_config.toml if it doesn't already exist.

# edit the config
sudo vi /etc/flapjack/flapjack_config.toml

# reload the config
sudo /etc/init.d/flapjack reload

Running

Ubuntu Precise 64:

After installing the Flapjack package, Redis and Flapjack should be automatically started.

First up, start Redis if it's not already started:

# status:
sudo /etc/init.d/redis-flapjack status

# start:
sudo /etc/init.d/redis-flapjack start

Operating Flapjack:

# status:
sudo /etc/init.d/flapjack status

# reload:
sudo /etc/init.d/flapjack reload

# restart:
sudo /etc/init.d/flapjack restart

# stop:
sudo /etc/init.d/flapjack stop

# start:
sudo /etc/init.d/flapjack start

Usage

Please see the documentation.

Developing Flapjack

Information on developing more Flapjack components or contributing to core Flapjack development can be found in the Developing section of the docs.

Note that the master branch corresponds to Flapjack 2; maintenance builds for Flapjack 1 are built from the maint/1.x branch.

Documentation Submodule

We have the documentation for this project on a github wiki and also referenced as a submodule at /doc in this project. Run the following commands to populate the local doc/ directory:

git submodule init
git submodule update

If you make changes to the documentation locally, here's how to publish them:

  • Checkout master within the doc subdir, otherwise you'll be commiting to no branch, a.k.a. no man's land.
  • git add, commit and push from inside the doc subdir
  • Add, commit and push the doc dir from the root (this updates the pointer in the main git repo to the correct ref in the doc repo, we think...)

RTFM

All of the documentation.

vagrant-flapjack's People

Contributors

adrianlzt avatar ali-graham avatar aussielunix avatar auxesis avatar bs-github avatar danp avatar jessereynolds avatar mholttech avatar pblittle avatar sarahriley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vagrant-flapjack's Issues

Icinga external commands fail due to permissions on

Calling external commands in the icinga web UI gives a big red error message about the permissions being wrong on /var/lib/icinga/rw/icinga.cmd

Error: Could not open command file '/var/lib/icinga/rw/icinga.cmd' for update!

Failing capybara example - media and entity were added to contact

Seems like a timing issue - capybara not waiting for the javascript call to update the address when the modal is closed

Failures:

  1. Contact Management Checks media and entity were added to contact
    Failure/Error: content.each { |c| expect(page).to have_content c }
    expected to find text "foo-app-01" in "Summary Entities Failing Entities Checks Failing Checks Contacts Internal Statistics Test Guy Contact Media Media Address Interval Summary Mode Summary Threshold Email [email protected] 15 seconds No - 0 alerting 3 Jabber [email protected] 15 seconds No - 0 alerting 3 Alerting Checks Alerting checks are any that are failing, not acknowledged, not in scheduled maintenance, and currently allowed by this contact's notification rules. There are no currently alerting checks. Notification Rules ID Entities Entities Regex Tags Tags Regex Warning Media Critical Media Time Restrictions Blackholes d8a8cb77-d5a4-4d12-a47c-b903aba4ab72 - - - - email, sms, sms_twilio, jabber, pagerduty, sns email, sms, sms_twilio, jabber, pagerduty, sns [] All Entities and Checks No entities Flapjack version 1.2.0 | Flapjack Website | Flapjack on GitHub"

    ./spec/capybara/03_contacts_spec.rb:94:in `block (3 levels) in <top (required)>'

    ./spec/capybara/03_contacts_spec.rb:94:in`each'

    ./spec/capybara/03_contacts_spec.rb:94:in `block (2 levels) in <top (required)>'

Finished in 46.26 seconds (files took 0.77824 seconds to load)
20 examples, 1 failure, 1 pending

Failed examples:

rspec ./spec/capybara/03_contacts_spec.rb:83 # Contact Management Checks media and entity were added to contact
/Users/jesse/.rbenv/versions/2.1.4/bin/ruby -I/Users/jesse/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib /Users/jesse/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/exe/rspec --pattern spec/capybara/*_spec.rb failed

Clean up puppet manifests

I think a bunch of things are not being used and can be vapourised? Ie, a bunch of unused things from the flapjack module:

modules/flapjack:

  • manifests/common.pp
  • manifests/coordinator.pp
  • manifests/flapper.pp
  • manifests/nagios-receiver.pp
  • manifests/nginx.pp
  • manifests/stats.pp
  • manifests/web_api.pp
  • files/*
  • templates/*

and a bunch of modules that aren't being used:

  • modules/ruby
  • modules/logrotate
  • modules/redis

Failure to start with Error: Could not parse application options: invalid option: --manifestdir

Hi

With Vagrant v1.7.4 + Virtualbox 5.0.10 I received what appeared to be a fatal error on distro_release=trusty vagrant up:

Bringing machine 'flapjack' up with 'virtualbox' provider...
==> flapjack: Box 'puppetlabs/ubuntu-14.04-64-puppet' could not be found. Attempting to find and install...
    flapjack: Box Provider: virtualbox
    flapjack: Box Version: >= 0
==> flapjack: Loading metadata for box 'https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-puppet'
    flapjack: URL: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-puppet
==> flapjack: Adding box 'puppetlabs/ubuntu-14.04-64-puppet' (v1.0.2) for provider: virtualbox
    flapjack: Downloading: https://atlas.hashicorp.com/puppetlabs/boxes/ubuntu-14.04-64-puppet/versions/1.0.2/providers/virtualbox.box
==> flapjack: Box download is resuming from prior download progress
==> flapjack: Successfully added box 'puppetlabs/ubuntu-14.04-64-puppet' (v1.0.2) for 'virtualbox'!
==> flapjack: Importing base box 'puppetlabs/ubuntu-14.04-64-puppet'...
==> flapjack: Matching MAC address for NAT networking...
==> flapjack: Checking if box 'puppetlabs/ubuntu-14.04-64-puppet' is up to date...
==> flapjack: Setting the name of the VM: vagrant-flapjack_flapjack_1449897263739_18696
==> flapjack: Clearing any previously set network interfaces...
==> flapjack: Preparing network interfaces based on configuration...
    flapjack: Adapter 1: nat
==> flapjack: Forwarding ports...
    flapjack: 3000 => 3000 (adapter 1)
    flapjack: 3071 => 3071 (adapter 1)
    flapjack: 3080 => 3080 (adapter 1)
    flapjack: 3081 => 3081 (adapter 1)
    flapjack: 3082 => 3082 (adapter 1)
    flapjack: 80 => 3083 (adapter 1)
    flapjack: 443 => 3084 (adapter 1)
    flapjack: 1080 => 1080 (adapter 1)
    flapjack: 5222 => 5222 (adapter 1)
    flapjack: 4567 => 4567 (adapter 1)
    flapjack: 15672 => 15672 (adapter 1)
    flapjack: 22 => 2222 (adapter 1)
==> flapjack: Running 'pre-boot' VM customizations...
==> flapjack: Booting VM...
==> flapjack: Waiting for machine to boot. This may take a few minutes...
    flapjack: SSH address: 127.0.0.1:2222
    flapjack: SSH username: vagrant
    flapjack: SSH auth method: private key
    flapjack: Warning: Connection timeout. Retrying...
    flapjack:
    flapjack: Vagrant insecure key detected. Vagrant will automatically replace
    flapjack: this with a newly generated keypair for better security.
    flapjack:
    flapjack: Inserting generated public key within guest...
    flapjack: Removing insecure key from the guest if it's present...
    flapjack: Key inserted! Disconnecting and reconnecting using new SSH key...
==> flapjack: Machine booted and ready!
==> flapjack: Checking for guest additions in VM...
    flapjack: The guest additions on this VM do not match the installed version of
    flapjack: VirtualBox! In most cases this is fine, but in rare cases it can
    flapjack: prevent things such as shared folders from working properly. If you see
    flapjack: shared folder errors, please make sure the guest additions within the
    flapjack: virtual machine match the version of VirtualBox you have installed on
    flapjack: your host and reload your VM.
    flapjack:
    flapjack: Guest Additions Version: 4.3.22
    flapjack: VirtualBox Version: 5.0
==> flapjack: Setting hostname...
==> flapjack: Mounting shared folders...
    flapjack: /vagrant => /Users/andy/projects/vagrant-flapjack
    flapjack: /tmp/vagrant-cache => /Users/andy/.vagrant.d/cache/puppetlabs/ubuntu-14.04-64-puppet
    flapjack: /tmp/vagrant-puppet/modules-2c08598db2b6c0036d6d53a7f05e1cb8 => /Users/andy/projects/vagrant-flapjack/dist/modules
    flapjack: /tmp/vagrant-puppet/manifests-54bcc4dc84b6512eb69efc79bb64de40 => /Users/andy/projects/vagrant-flapjack/dist/manifests
==> flapjack: Configuring cache buckets...
==> flapjack: Running provisioner: puppet...
==> flapjack: Running Puppet with site.pp...
==> flapjack: stdin: is not a tty
==> flapjack: Error: Could not parse application options: invalid option: --manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Taking a hint from hashicorp/vagrant#6128 I added config.vm.box_version = '1.0.1' into the Vagrantfile and I had more success.

Not sure if this is a matter of waiting for the next Vagrant release, or if it would be helpful to make that change in this repo for now. Being new to Vagrant I'm not sure what the negative impacts might be. Happy to submit a PR if none.

Include mailcatcher to inspect email emitted by flapjack

To aid when evaluating or testing flapjack's behaviour, we could possibly include mailcatcher running on default ports (SMTP listener on 1025, HTTP on 1080) and have flapjack configured to send emails to it. It may be a better default option than having the email gateway disabled by default.

Here's a screen shot of mailcatcher being used in development.

screen shot 2013-10-22 at 9 19 00 pm

centos fails on erlang dependency with sensu

Run like so:

distro_release='centos-6' flapjack_component='experimental' vagrant up
==> flapjack: Error: Execution of '/bin/rpm -i http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5-1.noarch.rpm' returned 1: error: Failed dependencies:
==> flapjack:   erlang >= R12B-3 is needed by rabbitmq-server-3.1.5-1.noarch
==> flapjack: Error: /Stage[main]/Rabbitmq::Install/Package[rabbitmq-server]/ensure: change from absent to present failed: Execution of '/bin/rpm -i http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5-1.noarch.rpm' returned 1: error: Failed dependencies:
==> flapjack:   erlang >= R12B-3 is needed by rabbitmq-server-3.1.5-1.noarch

This is probably a good argument to not include Sensu and its dependencies by default on a vagrant up.

Failing serverspec tests

On Trusty (default):

$ rake serverspec
...
Failures:

  1) File "/var/log/flapjack/flapjack.log" should be owned by "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_owned_by 'flapjack' }
       expected `File "/var/log/flapjack/flapjack.log".owned_by?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%U\ /var/log/flapjack/flapjack.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:65:in `block (2 levels) in <top (required)>'

  2) File "/var/log/flapjack/flapjack.log" should be grouped into "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_grouped_into 'flapjack' }
       expected `File "/var/log/flapjack/flapjack.log".grouped_into?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%G\ /var/log/flapjack/flapjack.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:66:in `block (2 levels) in <top (required)>'

  3) File "/var/log/flapjack/notification.log" should be owned by "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_owned_by 'flapjack' }
       expected `File "/var/log/flapjack/notification.log".owned_by?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%U\ /var/log/flapjack/notification.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:72:in `block (2 levels) in <top (required)>'

  4) File "/var/log/flapjack/notification.log" should be grouped into "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_grouped_into 'flapjack' }
       expected `File "/var/log/flapjack/notification.log".grouped_into?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%G\ /var/log/flapjack/notification.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:73:in `block (2 levels) in <top (required)>'

  5) File "/var/log/flapjack/jsonapi_access.log" should be owned by "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_owned_by 'flapjack' }
       expected `File "/var/log/flapjack/jsonapi_access.log".owned_by?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%U\ /var/log/flapjack/jsonapi_access.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:79:in `block (2 levels) in <top (required)>'

  6) File "/var/log/flapjack/jsonapi_access.log" should be grouped into "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_grouped_into 'flapjack' }
       expected `File "/var/log/flapjack/jsonapi_access.log".grouped_into?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%G\ /var/log/flapjack/jsonapi_access.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:80:in `block (2 levels) in <top (required)>'

  7) File "/var/log/flapjack/redis-flapjack.log" should be mode 644
     On host `127.0.0.1'
     Failure/Error: it { should be_mode 644 }
       expected `File "/var/log/flapjack/redis-flapjack.log".mode?(644)` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%a\ /var/log/flapjack/redis-flapjack.log\ \|\ grep\ --\ \\\^644\\\$

     # ./spec/serverspec/flapjack_spec.rb:85:in `block (2 levels) in <top (required)>'

  8) File "/var/log/flapjack/web_access.log" should be owned by "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_owned_by 'flapjack' }
       expected `File "/var/log/flapjack/web_access.log".owned_by?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%U\ /var/log/flapjack/web_access.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:93:in `block (2 levels) in <top (required)>'

  9) File "/var/log/flapjack/web_access.log" should be grouped into "flapjack"
     On host `127.0.0.1'
     Failure/Error: it { should be_grouped_into 'flapjack' }
       expected `File "/var/log/flapjack/web_access.log".grouped_into?("flapjack")` to return true, got false
       sudo -p 'Password: ' /bin/sh -c stat\ -c\ \%G\ /var/log/flapjack/web_access.log\ \|\ grep\ --\ \\\^flapjack\\\$

     # ./spec/serverspec/flapjack_spec.rb:94:in `block (2 levels) in <top (required)>'

Finished in 3.26 seconds (files took 7.43 seconds to load)
57 examples, 9 failures

Failed examples:

rspec ./spec/serverspec/flapjack_spec.rb:65 # File "/var/log/flapjack/flapjack.log" should be owned by "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:66 # File "/var/log/flapjack/flapjack.log" should be grouped into "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:72 # File "/var/log/flapjack/notification.log" should be owned by "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:73 # File "/var/log/flapjack/notification.log" should be grouped into "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:79 # File "/var/log/flapjack/jsonapi_access.log" should be owned by "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:80 # File "/var/log/flapjack/jsonapi_access.log" should be grouped into "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:85 # File "/var/log/flapjack/redis-flapjack.log" should be mode 644
rspec ./spec/serverspec/flapjack_spec.rb:93 # File "/var/log/flapjack/web_access.log" should be owned by "flapjack"
rspec ./spec/serverspec/flapjack_spec.rb:94 # File "/var/log/flapjack/web_access.log" should be grouped into "flapjack"

I've been trying to use the FlapJack Vagrant box but to no avail

From @geek-kb, in flapjack/flapjack#725

Hi,

Seems like it just won't work:

itaig@iganot-lt:/opt/vagrant-flapjack$ distro_release=trusty vagrant up
Bringing machine 'flapjack' up with 'virtualbox' provider...
[flapjack] Box 'puppetlabs/ubuntu-14.04-64-puppet' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading box from URL: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-puppet
Extracting box...e: 0/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

Cannot start vagrant-flapjack vm in virtualbox

Hi there.

I'm trying to start my vm using vagrant up and VB gui.

vagrant up:
the guest machine entered an invalid state..
same issue (hashicorp/vagrant#2157)

Using VB gui: VT-x is disabled in BIOS.

Is there a workaround for this issue?

Vagrant 1.5.1_x86_64
VirtualBox 4.3_4.3.10
My OS: Ubuntu 13.

Thanks.

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.