1 define profile::monitoring::local_service (
2 Optional[Hash] $sudos = {},
3 Optional[Hash] $common = {},
4 Optional[Hash] $master = {},
5 Optional[Hash] $local = {},
7 include profile::monitoring::params
9 $service_description = $title
15 notify => Service["naemon"],
16 before => Service["naemon"],
17 require => File["/etc/naemon"],
20 $sudos.each |$sudo_name, $content| {
21 ensure_resource("sudo::conf", $sudo_name, {
23 before => Nagios_service[$service_description],
27 [true, false].each |$services_for_master| {
28 if $services_for_master {
31 target => $::profile::monitoring::params::services_for_master,
32 check_interval => $::profile::monitoring::params::service_local["check_interval"],
33 retry_interval => $::profile::monitoring::params::service_local["retry_interval"],
34 host_name => $::profile::monitoring::params::service_local["host_name"],
35 use => $::profile::monitoring::params::service_types["passive"],
39 $services_key = $master
41 $default_local = merge(
42 $::profile::monitoring::params::service_local,
43 { target => $::profile::monitoring::params::objects }
46 $services_key = $local
49 $hash = merge($default_local, $common, $services_key)
51 nagios_service { "$t$service_description":
52 service_description => $service_description,