diff options
Diffstat (limited to 'modules/profile/manifests/monitoring.pp')
-rw-r--r-- | modules/profile/manifests/monitoring.pp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/modules/profile/manifests/monitoring.pp b/modules/profile/manifests/monitoring.pp new file mode 100644 index 0000000..8633626 --- /dev/null +++ b/modules/profile/manifests/monitoring.pp | |||
@@ -0,0 +1,58 @@ | |||
1 | class profile::monitoring ( | ||
2 | Optional[String] $naemon_url = undef, | ||
3 | Optional[String] $naemon_token = undef, | ||
4 | ) inherits profile::monitoring::params { | ||
5 | ensure_packages(["naemon", "cnagios"]) | ||
6 | |||
7 | file { "/etc/naemon": | ||
8 | ensure => "directory", | ||
9 | recurse => true, | ||
10 | purge => true, | ||
11 | force => true, | ||
12 | require => Package["naemon"], | ||
13 | } | ||
14 | -> | ||
15 | file { "/etc/naemon/resource.cfg": | ||
16 | ensure => "file", | ||
17 | owner => "naemon", | ||
18 | group => "naemon", | ||
19 | mode => "0600", | ||
20 | content => template("profile/monitoring/resource.cfg.erb"), | ||
21 | } | ||
22 | -> | ||
23 | file { "/etc/naemon/naemon.cfg": | ||
24 | ensure => "file", | ||
25 | owner => "naemon", | ||
26 | group => "naemon", | ||
27 | mode => "0644", | ||
28 | content => template("profile/monitoring/naemon.cfg.erb"), | ||
29 | } | ||
30 | -> | ||
31 | file { $objects: | ||
32 | ensure => "file", | ||
33 | owner => "naemon", | ||
34 | group => "naemon", | ||
35 | mode => "0600" | ||
36 | } | ||
37 | -> | ||
38 | service { "naemon": | ||
39 | ensure => "running", | ||
40 | enable => true, | ||
41 | } | ||
42 | |||
43 | unless ($naemon_url == undef or empty($naemon_url)) { | ||
44 | file { "/etc/naemon/send_nrdp.sh": | ||
45 | ensure => "file", | ||
46 | owner => "naemon", | ||
47 | group => "naemon", | ||
48 | mode => "0700", | ||
49 | content => template("profile/monitoring/send_nrdp.sh.erb"), | ||
50 | } | ||
51 | } | ||
52 | |||
53 | include "profile::monitoring::hosts" | ||
54 | include "profile::monitoring::services" | ||
55 | include "profile::monitoring::commands" | ||
56 | include "profile::monitoring::times" | ||
57 | include "profile::monitoring::contacts" | ||
58 | } | ||