Puppet Class: raid::hpsa

Defined in:
modules/raid/manifests/hpsa.pp

Overview

HP Raid controller



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
65
# File 'modules/raid/manifests/hpsa.pp', line 2

class raid::hpsa {
  include raid
  require_package('hpssacli', 'hpssaducli', 'lsscsi')

  file { '/usr/local/lib/nagios/plugins/check_hpssacli':
    ensure => present,
    owner  => 'root',
    group  => 'root',
    mode   => '0555',
    source => 'puppet:///modules/raid/dsa-check-hpssacli',
  }

  sudo::user { 'nagios_hpssacli':
    user       => 'nagios',
    privileges => [
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller all show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller all show detail',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] ld all show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] ld all show detail',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] ld * show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] pd all show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] pd all show detail',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] pd [0-9]\:[0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] pd [0-9][EIC]\:[0-9]\:[0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] pd [0-9][EIC]\:[0-9]\:[0-9][0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] show status',
      'ALL = NOPASSWD: /usr/sbin/hpssacli controller slot=[0-9] show detail',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller all show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] ld all show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] ld * show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] pd all show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] pd [0-9]\:[0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] pd [0-9][EIC]\:[0-9]\:[0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] pd [0-9][EIC]\:[0-9]\:[0-9][0-9] show',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] show status',
      'ALL = NOPASSWD: /usr/sbin/hpacucli controller slot=[0-9] show detail',
    ],
  }

  nrpe::monitor_service { 'raid_hpssacli':
    description    => 'HP RAID',
    nrpe_command   => '/usr/local/lib/nagios/plugins/check_hpssacli',
    timeout        => 90, # can take > 10s on servers with lots of disks
    check_interval => $raid::check_interval,
    retry_interval => $raid::retry_interval,
    event_handler  => "raid_handler!hpssacli!${::site}",
    notes_url      => 'https://wikitech.wikimedia.org/wiki/Dc-operations/Hardware_Troubleshooting_Runbook#Hardware_Raid_Information_Gathering',
  }

  $get_raid_status_hpssacli = '/usr/local/lib/nagios/plugins/get-raid-status-hpssacli'

  file { $get_raid_status_hpssacli:
    ensure => present,
    owner  => 'root',
    group  => 'root',
    mode   => '0555',
    source => 'puppet:///modules/raid/get-raid-status-hpssacli.sh';
  }

  nrpe::check { 'get_raid_status_hpssacli':
    command => "${get_raid_status_hpssacli} -c",
  }

}