1 define profile::monitoring::local_service (
2 Optional[Hash] $sudos = {},
3 Optional[Hash] $common = {},
4 Optional[Hash] $master = {},
5 Optional[Hash] $local = {},
7 $service_description = $title
8 $real_hostname = lookup("base_installation::real_hostname")
14 notify => Service["naemon"],
15 before => Service["naemon"],
16 require => File["/etc/naemon"],
20 active_checks_enabled => "1",
21 check_freshness => "0",
22 check_interval => "10",
23 check_period => "24x7",
24 contact_groups => "admins",
25 event_handler_enabled => "1",
26 flap_detection_enabled => "1",
28 max_check_attempts => "3",
29 notification_interval => "60",
30 notification_options => "w,u,c,r",
31 notification_period => "24x7",
32 notifications_enabled => "0",
33 obsess_over_service => "1",
34 passive_checks_enabled => "1",
35 process_perf_data => "1",
36 retain_nonstatus_information => "1",
37 retain_status_information => "1",
38 retry_interval => "2",
41 $service_local = merge($service_generic, {
42 host_name => $real_hostname,
43 check_interval => "5",
44 max_check_attempts => "4",
45 retry_interval => "1",
48 $sudos.each |$sudo_name, $content| {
49 sudo::conf { $sudo_name:
51 before => Nagios_service[$service_description],
55 [true, false].each |$services_for_master| {
56 if $services_for_master {
59 target => "/etc/naemon/services_for_master.cfg",
60 check_interval => $service_local["check_interval"],
61 retry_interval => $service_local["retry_interval"],
62 host_name => $service_local["host_name"],
63 use => "external-service",
67 $services_key = $master
69 $default_local = merge($service_local, { target => "/etc/naemon/objects.cfg" })
71 $services_key = $local
74 $hash = merge($default_local, $common, $services_key)
76 nagios_service { "$t$service_description":
77 service_description => $service_description,