0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby DSL for generating Nagios check definitions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 11.1.1
~> 0.38
 Project Readme

AlertDesigner

Build Status Coverage Status Code Climate gem version MIT license

Overview

AlertDesigner is a Ruby DSL to create Nagios checks. It attempts to take some of the repetitive work of creating Nagios alerts away. It's supposed to complement your existing setup and not necessarily replace it.

This project is no longer actively maintained as I'm not using Nagios anymore. If you have a use case for it and are interested in maintaining, let me know on Twitter.

Example

AlertDesigner.define do

  # let's use the Nagios formatter
  formatter NagiosFormatter do
    check_template "generic-service"
  end

  {
    "check_nrpe"       => "$USER1$/check_nrpe2 -H $HOSTADDRESS$ -c $ARG1$ -t 30",
    "check_local_disk" => "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$",
  }.each do |name, check_cmd|

    command name do
      command check_cmd
    end
  end

  # a simple disk space check
  check "/ Partition Disk Space" do
    hostgroups ["freebsd-base"]
    command  "check_nrpe!check_root"
  end

  # define some base checks with repeating properties
  {
    "vulnerable packages"      => "check_nrpe!check_portaudit",
    "FreeBSD security updates" => "check_nrpe!check_freebsd_update",
    "FreeBSD kernel version"   => "check_nrpe!check_freebsd_kernel",
    "zpool status"             => "check_nrpe!check_zpool"
  }.each do |description, check_cmd|

    check description do
      hostgroups ["freebsd-base"]
      command check_cmd
    end

  end

  # set contact groups for specific clusters
  check "Apache Running" do
    hostgroups ["WebServers" => "web-team", "ApiServers" => "api-team"]
    command  "check_nrpe!check_httpd"
  end

end

puts AlertDesigner.format

Installation

Install from rubygems:

gem install alertdesigner

Or in your Gemfile:

gem 'alertdesigner'

FAQ

Couldn't most of this be done with a clever config hierarchy?

Probably.

Inspiration