Puppet Class: openstack::cinder::monitor

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

Overview

Parameters:

  • active (Any)
  • critical (Any) (defaults to: false)
  • contact_groups (Any) (defaults to: 'wmcs-bots,admins')


1
2
3
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'modules/openstack/manifests/cinder/monitor.pp', line 1

class openstack::cinder::monitor(
    $active,
    $critical=false,
    $contact_groups='wmcs-bots,admins',
) {

    require openstack::cinder::service

    # nagios doesn't take a bool
    if $active {
        $ensure = 'present'
    }
    else {
        $ensure = 'absent'
    }

    monitoring::service { 'cinder-api':
        ensure        => $ensure,
        description   => 'cinder-api http',
        check_command => 'check_http_on_port!18776',
        contact_group => $contact_groups,
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Troubleshooting',
    }

    nrpe::monitor_service { 'check_cinder_scheduler_process':
        ensure        => $ensure,
        critical      => $critical,
        description   => 'cinder-scheduler process',
        nrpe_command  => "/usr/lib/nagios/plugins/check_procs -c 1: --ereg-argument-array '^/usr/bin/python.* /usr/bin/cinder-scheduler'",
        contact_group => $contact_groups,
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Troubleshooting',
    }

    nrpe::monitor_service { 'check_cinder_volume_process':
        ensure        => $ensure,
        critical      => $critical,
        description   => 'cinder-volume process',
        nrpe_command  => "/usr/lib/nagios/plugins/check_procs -c 1: --ereg-argument-array '^/usr/bin/python.* /usr/bin/cinder-volume'",
        contact_group => $contact_groups,
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Troubleshooting',
    }

    # The backup process uses snapshots owned by the 'admin' project.
    #
    # There should really never be more than one snapshot at a time
    #  since we clean them up after running the backup job. Alert
    #  if snapshots start to pile up.
    file { '/usr/local/bin/check_cinder_snapshot_leaks.py':
        ensure => 'present',
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        source => 'puppet:///modules/openstack/monitor/cinder/check_cinder_snapshot_leaks.py',
    }

    nrpe::monitor_service { 'check-cinder-snapshot-leaks':
        ensure        => 'present',
        nrpe_command  => '/usr/local/bin/check_cinder_snapshot_leaks.py',
        description   => 'Check for snapshots leaked by cinder backup agent',
        require       => File['/usr/local/bin/check_cinder_snapshot_leaks.py'],
        contact_group => 'wmcs-team-email,admins',
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Runbooks/Check_for_snapshots_leaked_by_cinder_backup_agent',
    }
}