diff options
Diffstat (limited to 'modules/profile/manifests/monitoring/hosts.pp')
-rw-r--r-- | modules/profile/manifests/monitoring/hosts.pp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/profile/manifests/monitoring/hosts.pp b/modules/profile/manifests/monitoring/hosts.pp new file mode 100644 index 0000000..f7802be --- /dev/null +++ b/modules/profile/manifests/monitoring/hosts.pp | |||
@@ -0,0 +1,45 @@ | |||
1 | class profile::monitoring::hosts inherits profile::monitoring::params { | ||
2 | $real_hostname = lookup("base_installation::real_hostname") | ||
3 | |||
4 | Nagios_hostgroup { | ||
5 | ensure => "present", | ||
6 | owner => "naemon", | ||
7 | group => "naemon", | ||
8 | target => $objects, | ||
9 | notify => Service["naemon"], | ||
10 | before => Service["naemon"], | ||
11 | require => File["/etc/naemon"], | ||
12 | } | ||
13 | |||
14 | Nagios_host { | ||
15 | ensure => "present", | ||
16 | owner => "naemon", | ||
17 | group => "naemon", | ||
18 | target => $objects, | ||
19 | notify => Service["naemon"], | ||
20 | before => Service["naemon"], | ||
21 | require => File["/etc/naemon"], | ||
22 | } | ||
23 | |||
24 | nagios_hostgroup { "linux-servers": | ||
25 | alias => "Linux Servers", | ||
26 | members => [$real_hostname], | ||
27 | } | ||
28 | |||
29 | $host_linux_server = { | ||
30 | check_command => "check-host-alive", | ||
31 | check_interval => 5, | ||
32 | check_period => "24x7", | ||
33 | contact_groups => "admins", | ||
34 | max_check_attempts => "10", | ||
35 | notification_interval => "120", | ||
36 | notification_options => "d,u,r", | ||
37 | retry_interval => "1", | ||
38 | } | ||
39 | |||
40 | nagios_host { $real_hostname: | ||
41 | address => $real_hostname; | ||
42 | default: * => $host_linux_server, | ||
43 | } | ||
44 | |||
45 | } | ||