Project

maintainer

0.0
No commit activity in last 3 years
No release in over 3 years
Submits maintainance events to Riemann.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.2.8, ~> 0.2
 Project Readme

Maintainer

Sends maintenance events to Riemann.

Getting started

gem install maintainer
maintainer --help

Usage

Generates a maintenance event that you can inject into the Riemann index and use to indicate a host is in maintenance mode.

The state of the event defaults to active but you can specify an alternate state with the --event-state flag.

The :service field defaults to maintenance-mode but can be overridden with the --event-service flag. The host defaults to the host the command is run on but can be overridden with the --event-host flag.

Starting maintenance

maintainer --host riemann.example.com
{:host server.example.com, :service maintenance-mode, :state
active, :description Maintenance is active, :type maintenance-mode, :metric nil,
:tags nil, :time 1457278453, :ttl Infinity}

You will see a new attribute called :type with a value of maintenance-mode that you could also use for filtering.

Ending maintenance

maintainer --host riemann.example.com --event-state inactive
{:host server.example.com, :service maintenance-mode, :state
inactive, :description Maintenance is inactive, :type maintenance-mode,
:metric nil, :tags nil, :time 1457278567, :ttl Infinity}

Riemann configuration

We would define a function that checks for maintenance events.

(defn maintenance-mode?
  "Is it currently in maintenance mode?"
  [event]
  (->> '(and (= host (:host event))
             (= service "maintenance-mode"))
       (riemann.index/search (:index @core))
       first
       :state
       (= "active")))

And then use that function to control when notifications are generated:

(where (not (maintenance-mode? event))
  (pagerduty))