Puppet Class: monitoring::service::reboot

Defined in:
manifests/service/reboot.pp

Overview



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
# File 'manifests/service/reboot.pp', line 2

class monitoring::service::reboot {
  include ::monitoring
  $ensure               = $::monitoring::ensure
  $nagios_extra_plugins = $::monitoring::nagios_extra_plugins
  $host_name            = $::monitoring::host_name

  monitoring::service { 'reboot':
    service_type         => 'passive_service',
    service_description  => 'REBOOT',
    servicegroups        => 'system',
    check_command        => 'check_nrpe!check_dummy',
    max_check_attempts   => 1,
    notification_options => 'w',
    contact_groups       => 'admins,linux_admins',
    sms_contact_groups   => 'linux_admin_sms',
  }

  file { '/etc/cron.d/reboot_alert':
    ensure  => $ensure,
    content => "@reboot root perl ${nagios_extra_plugins}/server_reboot_alert.pl --nagiosname=${::monitoring::host_name}",
    owner   => root,
    group   => root,
    mode    => '0644',
  }

  monitoring::script { 'server_reboot_alert.pl':
    template => 'monitoring/scripts/server_reboot_alert.pl.erb',
  }

}