Puppet Class: nagios::check::ssd

Defined in:
manifests/check/ssd.pp

Overview

Parameters:

  • ensure (Any) (defaults to: undef)
  • args (Any) (defaults to: '')
  • package (Any) (defaults to: [ 'bc', 'smartmontools', 'pciutils', 'lsscsi' ])
  • vendor_package (Any) (defaults to: undef)
  • check_title (Any) (defaults to: $::nagios::client::host_name)
  • servicegroups (Any) (defaults to: undef)
  • check_period (Any) (defaults to: $::nagios::client::service_check_period)
  • contact_groups (Any) (defaults to: $::nagios::client::service_contact_groups)
  • first_notification_delay (Any) (defaults to: $::nagios::client::service_first_notification_delay)
  • max_check_attempts (Any) (defaults to: $::nagios::client::service_max_check_attempts)
  • notification_period (Any) (defaults to: $::nagios::client::service_notification_period)
  • use (Any) (defaults to: $::nagios::client::service_use)


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
# File 'manifests/check/ssd.pp', line 1

class nagios::check::ssd (
  $ensure                   = undef,
  $args                     = '',
  $package                  = [ 'bc', 'smartmontools', 'pciutils', 'lsscsi' ],
  $vendor_package           = undef,
  $check_title              = $::nagios::client::host_name,
  $servicegroups            = undef,
  $check_period             = $::nagios::client::service_check_period,
  $contact_groups           = $::nagios::client::service_contact_groups,
  $first_notification_delay = $::nagios::client::service_first_notification_delay,
  $max_check_attempts       = $::nagios::client::service_max_check_attempts,
  $notification_period      = $::nagios::client::service_notification_period,
  $use                      = $::nagios::client::service_use,
) {

  # Install vendor specific package of storcli
  if $ensure != 'absent' {
    if $vendor_package {
      ensure_packages($vendor_package)
    } elsif $::bios_vendor == 'Dell Inc.' {
      # Assuming DELL server only have PERC cards >.<
      ensure_packages('perccli')
    } else {
      ensure_packages('storcli')
    }
  }

  # Sudoers file for priviledged commands
  file { '/etc/sudoers.d/nagios_check_ssd':
    owner   => 'root',
    group   => 'root',
    mode    => '0440',
    # We customize the user, the nagios plugin dir and few other things
    content => template('nagios/plugins/check_ssd-sudoers.erb'),
  }

  nagios::client::nrpe_plugin { 'check_ssd':
    ensure  => $ensure,
    # Main LSI package and command, used by the check script
    package => $package,
  }

  nagios::client::nrpe_file { 'check_ssd':
    ensure => $ensure,
    args   => $args,
  }

  nagios::service { "check_ssd_${check_title}":
    ensure                   => $ensure,
    check_command            => 'check_nrpe_ssd',
    service_description      => 'ssd',
    servicegroups            => $servicegroups,
    check_period             => $check_period,
    contact_groups           => $contact_groups,
    first_notification_delay => $first_notification_delay,
    notification_period      => $notification_period,
    max_check_attempts       => $max_check_attempts,
    use                      => $use,
  }

}