example42/puppet-monitor

Name: puppet-monitor

Owner: Example42

Description: Example42 Monitor abstraction meta-module

Created: 2012-01-12 09:37:52.0

Updated: 2017-07-19 16:21:45.0

Pushed: 2016-08-12 21:02:02.0

Homepage: http://www.example42.com

Size: 67

Language: Puppet

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Deprecation notice

This module was designed for Puppet versions 2 and 3. It should work also on Puppet 4 but doesn't use any of its features.

The current Puppet 3 compatible codebase is no longer actively maintained by example42.

Still, Pull Requests that fix bugs or introduce backwards compatible features will be accepted.

Puppet module: monitor

This is a Puppet abstraction module to manage monitoring.

Made by Alessandro Franceschi / Lab42 - http://www.example42.com

Released under the terms of Apache 2 License.

Check Modulefile for dependencies.

Goal of this module

This module abstracts the monitoring definitions for an host or application, in order to add and use different monitoring methods, without changes on the single application modules.

It's used, as an option disabled by default, in the Example42 modules and provides:

Usage

In order to activate automatic monitoring for the resources defined in a class you have to pass, at least, these parameters:

    class { "foo":
      monitor      => true,
      monitor_tool => [ "nagios" , "monit" , "munin" ],
    }

where monitor_tool is an array of the monitor tools you want to activate to automatically check the resources provided the defined class.

In Example42 modules, when monitoring is active, for applications that provide network services, is activated the monitoring of the listening port and the running process, with a syntax like this:

    monitor::port { "foo_${foo::protocol}_${foo::port}": 
      protocol => "${foo::protocol}",
      port     => "${foo::port}",
      target   => "${foo::params::monitor_target_real}",
      tool     => "${foo::monitor_tool}",
      enable   => $foo::manage_monitor,
    }

    monitor::process { "foo_process":
      process  => "${foo::process}",
      service  => "${foo::service}",
      pidfile  => "${foo::pidfile}",
      tool     => "${foo::monitor_tool}",
      enable   => $foo::manage_monitor,
    }

Modules related to web applications generally have a monitor::url define that checks for a specifyed pattern string in an given url:

    monitor::url { "foo_webapp_url":
      url     => "${foo_webapp::url_check}",
      pattern => "${foo_webapp::url_pattern}",
      port    => "${foo_webapp::port}",
      target  => "${fqdn}",
      tool    => "${foo_webapp::monitor_tool}",
      enable  => $foo_webapp::manage_monitor,
    }
Monitor module layout

This monitor module is to be considered a (working) implementation, entirely based on Puppet's DSL of a (strongly needed) monitor abstraction type. The generic monitor defines are placed in files like:

    monitor/manifests/process.pp
    monitor/manifests/port.pp
    monitor/manifests/url.pp

here according to the monitor_tool requested are called some specific defines relevant to the requested monitoring tools. Note that here you can choose different implementations of monitoring modules, so you are free to change the whole module to be used for a specific monitoring tool editing just these few files.

Dependencies

This is a meta-module that needs dependencies according to the monitor tools modules you use. It also requires Example42's puppi module. IMPORTANT: You must have storeconfigs enabled on your PuppetMaster to use monitoring tools that involve a central server, like Nagios or Munin.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.