Puppet Class: openstack::monitor::spreadcheck

Defined in:
modules/openstack/manifests/monitor/spreadcheck.pp

Overview

Class: openstack::monitor::spreadcheck

NRPE check to see if critical instances for a project are spread out enough among the labvirt* hosts

Parameters:

  • active (Any)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'modules/openstack/manifests/monitor/spreadcheck.pp', line 4

class openstack::monitor::spreadcheck(
    $active,
) {
    # monitoring::service doesn't take a bool
    if $active {
        $ensure = 'present'
    }
    else {
        $ensure = 'absent'
    }

    # Script that checks how 'spread out' critical instances for a project
    # are. See T101635
    file { '/usr/local/sbin/wmcs-spreadcheck':
        ensure => $ensure,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        source => 'puppet:///modules/openstack/monitor/wmcs-spreadcheck.py',
    }

    ['tools', 'deployment-prep', 'cloudinfra'].each |String $project| {
        file { "/etc/wmcs-spreadcheck-${project}.yaml":
            ensure => $ensure,
            owner  => 'nagios',
            group  => 'nagios',
            mode   => '0400',
            source => "puppet:///modules/openstack/monitor/wmcs-spreadcheck-${project}.yaml",
        }
        nrpe::monitor_service { "check-${project}-spread":
            ensure       => $ensure,
            nrpe_command => "/usr/local/sbin/wmcs-spreadcheck --config /etc/wmcs-spreadcheck-${project}.yaml",
            description  => "${project} project instance distribution",
            require      => File[
                '/usr/local/sbin/wmcs-spreadcheck',
                "/etc/wmcs-spreadcheck-${project}.yaml"
            ],
            notes_url    => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Troubleshooting',
        }
    }
}