aboutsummaryrefslogtreecommitdiff
path: root/modules/profile
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-07-11 08:43:05 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-07-11 08:49:25 +0200
commit0cdf494080b285e81b531a38dbbac7f7d8e9c990 (patch)
tree2974b8d845c259aeb29565c658bebe2e8c8dafb2 /modules/profile
parent0363f38e186b8c942a6db2de4974befbc373f618 (diff)
downloadPuppet-0cdf494080b285e81b531a38dbbac7f7d8e9c990.tar.gz
Puppet-0cdf494080b285e81b531a38dbbac7f7d8e9c990.tar.zst
Puppet-0cdf494080b285e81b531a38dbbac7f7d8e9c990.zip
Monitor websites from master
Diffstat (limited to 'modules/profile')
-rw-r--r--modules/profile/manifests/monitoring/external_service.pp16
-rw-r--r--modules/profile/manifests/monitoring/local_service.pp2
-rw-r--r--modules/profile/manifests/monitoring/params.pp5
-rw-r--r--modules/profile/manifests/monitoring/services.pp1
4 files changed, 23 insertions, 1 deletions
diff --git a/modules/profile/manifests/monitoring/external_service.pp b/modules/profile/manifests/monitoring/external_service.pp
new file mode 100644
index 0000000..027dad8
--- /dev/null
+++ b/modules/profile/manifests/monitoring/external_service.pp
@@ -0,0 +1,16 @@
1define profile::monitoring::external_service (
2 Optional[String] $type = undef,
3 Optional[Hash] $master = {},
4) {
5 include profile::monitoring::params
6 $service_description = $title
7
8 nagios_service { $service_description:
9 service_description => $service_description,
10 host_name => $::profile::monitoring::params::service_local["host_name"],
11 use => $::profile::monitoring::params::service_types[$type],
12 target => $::profile::monitoring::params::services_for_master,
13 * => $master,
14 }
15
16}
diff --git a/modules/profile/manifests/monitoring/local_service.pp b/modules/profile/manifests/monitoring/local_service.pp
index 9544fdf..1f975f0 100644
--- a/modules/profile/manifests/monitoring/local_service.pp
+++ b/modules/profile/manifests/monitoring/local_service.pp
@@ -32,7 +32,7 @@ define profile::monitoring::local_service (
32 check_interval => $::profile::monitoring::params::service_local["check_interval"], 32 check_interval => $::profile::monitoring::params::service_local["check_interval"],
33 retry_interval => $::profile::monitoring::params::service_local["retry_interval"], 33 retry_interval => $::profile::monitoring::params::service_local["retry_interval"],
34 host_name => $::profile::monitoring::params::service_local["host_name"], 34 host_name => $::profile::monitoring::params::service_local["host_name"],
35 use => "external-passive-service", 35 use => $::profile::monitoring::params::service_types["passive"],
36 notify => [], 36 notify => [],
37 } 37 }
38 $t = "master - " 38 $t = "master - "
diff --git a/modules/profile/manifests/monitoring/params.pp b/modules/profile/manifests/monitoring/params.pp
index a647130..27f895e 100644
--- a/modules/profile/manifests/monitoring/params.pp
+++ b/modules/profile/manifests/monitoring/params.pp
@@ -5,6 +5,11 @@ class profile::monitoring::params {
5 $objects = "/etc/naemon/objects.cfg" 5 $objects = "/etc/naemon/objects.cfg"
6 $plugins = "/etc/naemon/monitoring-plugins" 6 $plugins = "/etc/naemon/monitoring-plugins"
7 7
8 $service_types = {
9 "passive" => "external-passive-service",
10 "web" => "external-web-service",
11 }
12
8 $service_generic = { 13 $service_generic = {
9 active_checks_enabled => "1", 14 active_checks_enabled => "1",
10 check_freshness => "0", 15 check_freshness => "0",
diff --git a/modules/profile/manifests/monitoring/services.pp b/modules/profile/manifests/monitoring/services.pp
index b20a352..95c6efb 100644
--- a/modules/profile/manifests/monitoring/services.pp
+++ b/modules/profile/manifests/monitoring/services.pp
@@ -38,4 +38,5 @@ class profile::monitoring::services {
38 } 38 }
39 39
40 Profile::Monitoring::Local_service <| |> 40 Profile::Monitoring::Local_service <| |>
41 Profile::Monitoring::External_service <| |>
41} 42}