Puppet Class: labstore::monitoring::primary

Defined in:
modules/labstore/manifests/monitoring/primary.pp

Overview

Parameters:

  • drbd_role (String)
  • cluster_iface (String)
  • cluster_ip (Stdlib::IP::Address)
  • critical (Boolean) (defaults to: false)
  • resource (String) (defaults to: 'all')
  • contact_groups (String) (defaults to: 'wmcs-team')


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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'modules/labstore/manifests/monitoring/primary.pp', line 12

class labstore::monitoring::primary(
    String $drbd_role,
    String $cluster_iface,
    Stdlib::IP::Address $cluster_ip,
    Boolean $critical = false,
    String $resource = 'all',
    String $contact_groups = 'wmcs-team',
){

    sudo::user { 'nagios_check_drbd':
        ensure => absent,
    }

    file { [
        '/usr/local/sbin/check_drbd_status',
        '/usr/local/sbin/check_drbd_role',
        '/usr/local/sbin/check_drbd_cluster_ip',
    ]:
        ensure => absent,
    }

    nrpe::plugin { 'check_drbd_status':
        source => 'puppet:///modules/labstore/monitor/check_drbd_status.py',
    }

    nrpe::monitor_service { 'check_drbd_status':
        critical      => $critical,
        description   => 'DRBD node status',
        nrpe_command  => "/usr/local/lib/nagios/plugins/check_drbd_status ${resource}",
        sudo_user     => 'root',
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_status'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    nrpe::plugin { 'check_drbd_role':
        source => 'puppet:///modules/labstore/monitor/check_drbd_role.py',
    }

    nrpe::monitor_service { 'check_drbd_role':
        critical      => $critical,
        description   => 'DRBD role',
        nrpe_command  => "/usr/local/lib/nagios/plugins/check_drbd_role ${::hostname} ${drbd_role}",
        sudo_user     => 'root',
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_role'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    nrpe::plugin { 'check_drbd_cluster_ip':
        source => 'puppet:///modules/labstore/monitor/check_drbd_cluster_ip.py',
    }

    nrpe::monitor_service { 'check_drbd_cluster_ip':
        critical      => $critical,
        description   => 'DRBD Cluster IP assignment',
        nrpe_command  => "/usr/local/lib/nagios/plugins/check_drbd_cluster_ip ${::hostname} ${drbd_role} ${cluster_iface} ${cluster_ip}",
        sudo_user     => 'root',
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_cluster_ip'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    nrpe::monitor_service { 'check_nfs_status':
        description   => 'NFS port is open on cluster IP',
        nrpe_command  => "/usr/lib/nagios/plugins/check_tcp -H ${cluster_ip} -p 2049 --timeout=2",
        contact_group => $contact_groups,
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }
}