1 define profile::monitoring::local_service (
2 Optional[Hash] $common = {},
3 Optional[Hash] $master = {},
4 Optional[Hash] $local = {},
6 $service_description = $title
7 $real_hostname = lookup("base_installation::real_hostname")
10 active_checks_enabled => "1",
11 check_freshness => "0",
12 check_interval => "10",
13 check_period => "24x7",
14 contact_groups => "admins",
15 event_handler_enabled => "1",
16 flap_detection_enabled => "1",
18 max_check_attempts => "3",
19 notification_interval => "60",
20 notification_options => "w,u,c,r",
21 notification_period => "24x7",
22 notifications_enabled => "0",
23 obsess_over_service => "1",
24 passive_checks_enabled => "1",
25 process_perf_data => "1",
26 retain_nonstatus_information => "1",
27 retain_status_information => "1",
28 retry_interval => "2",
31 $service_local = merge($service_generic, {
32 host_name => $real_hostname,
33 check_interval => "5",
34 max_check_attempts => "4",
35 retry_interval => "1",
39 [true, false].each |$services_for_master| {
40 if $services_for_master {
43 target => "/etc/naemon/services_for_master.cfg",
44 check_interval => $service_local["check_interval"],
45 retry_interval => $service_local["retry_interval"],
46 host_name => $service_local["host_name"],
47 use => "external-service",
51 $services_key = $master
53 $default_local = merge($service_local, { target => "/etc/naemon/objects.cfg" })
55 $services_key = $local
58 $hash = merge($default_local, $common, $services_key)
60 nagios_service { "$t$service_description":
61 service_description => $service_description,