Puppet Class: nagios::nrpe::pacemaker

Defined in:
manifests/nrpe/pacemaker.pp

Overview

Class: nagios::nrpe::pacemaker

This is going to check that all members are correctly connected to the pacemaker cluster. This uses a built in feature in pacemaker that provides nagios compatible monitoring. This is fully compatible with heartbeat and corosync. This will require sudo and so will add the nagios user to the sudoers file for this specific command.

Parameters

monitoring_environment

This is the environment that the check will be submitted for. This will default to the value set by nagios::nrpe::config but can be overridden here. Not required.

nagios_service

This is the generic service that this check will implement. This should be set by nagios::nrpe::config but can be overridden here. Not required.

nagios_alias

This is the hostname that the check will be submitted for. This should almost always be the hostname, but could be overriden, for instance when submitting a check for a virtual ip. Not required.

Authors

Ben Field <ben.field@concreteplatform.com

Parameters:

  • monitoring_environment (Any) (defaults to: $::nagios::nrpe::config::monitoring_environment)
  • nagios_service (Any) (defaults to: $::nagios::nrpe::config::nagios_service)
  • nagios_alias (Any) (defaults to: $::hostname)


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'manifests/nrpe/pacemaker.pp', line 28

class nagios::nrpe::pacemaker (
  $monitoring_environment = $::nagios::nrpe::config::monitoring_environment,
  $nagios_service         = $::nagios::nrpe::config::nagios_service,
  $nagios_alias           = $::hostname,) {
  require nagios::nrpe::config
  include nagios::nrpe::service

  file_line { 'pacemaker_sudoers':
    ensure => present,
    line   => 'nagios ALL=(ALL) NOPASSWD: /usr/sbin/crm_mon -s',
    path   => '/etc/sudoers',
    before => File_line['check_pacemaker'],
  }

  file_line { 'check_pacemaker':
    ensure => present,
    line   => 'command[check_pacemaker]=/usr/bin/sudo /usr/sbin/crm_mon -s',
    path   => '/etc/nagios/nrpe_local.cfg',
    match  => 'command\[check_pacemaker\]',
    notify => Service['nrpe'],
  }

  @@nagios_service { "check_pacemaker_${nagios_alias}":
    check_command       => 'check_nrpe_1arg!check_pacemaker',
    use                 => $nagios_service,
    host_name           => $nagios_alias,
    target              => "/etc/nagios3/conf.d/puppet/service_${nagios_alias}.cfg",
    service_description => "${nagios_alias}_check_pacemaker",
    tag                 => $monitoring_environment,
  }

}