aboutsummaryrefslogtreecommitdiff
path: root/modules/profile/manifests/monitoring/hosts.pp
blob: 306fe3e5a9e89bd56fa27967f10791a7a48f5f87 (plain) (blame)
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
class profile::monitoring::hosts {
  $real_hostname = lookup("base_installation::real_hostname")

  Nagios_hostgroup {
    ensure => "present",
    owner  => "naemon",
    group  => "naemon",
    target => "/etc/naemon/objects.cfg",
    notify => Service["naemon"],
    before => Service["naemon"],
  }

  Nagios_host {
    ensure => "present",
    owner  => "naemon",
    group  => "naemon",
    target => "/etc/naemon/objects.cfg",
    notify => Service["naemon"],
    before => Service["naemon"],
  }

  nagios_hostgroup { "linux-servers":
    alias   => "Linux Servers",
    members => [$real_hostname],
  }

  $host_linux_server = {
    check_command         => "check-host-alive",
    check_interval        => 5,
    check_period          => "24x7",
    contact_groups        => "admins",
    max_check_attempts    => "10",
    notification_interval => "120",
    notification_options  => "d,u,r",
    retry_interval        => "1",
  }

  nagios_host { $real_hostname:
    address => $real_hostname;
  default: * => $host_linux_server,
  }

}