summaryrefslogtreecommitdiff
path: root/manifests/service.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-06-13 15:41:24 +0200
committermh <mh@immerda.ch>2009-06-13 15:41:24 +0200
commit011d5e028f86e9eeba1c05e251063b45004d210e (patch)
treef17baaca735ed3a0e4f2b184da53c04d63435f66 /manifests/service.pp
parent783ae21de4cadbd9e8e3cdf62d4b0d6039586d78 (diff)
put everything into its own file
Diffstat (limited to 'manifests/service.pp')
-rw-r--r--manifests/service.pp52
1 files changed, 52 insertions, 0 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
new file mode 100644
index 0000000..42d9a4d
--- /dev/null
+++ b/manifests/service.pp
@@ -0,0 +1,52 @@
+define nagios::service(
+ $ensure = present,
+ $check_command,
+ $host_name = $fqdn,
+ $use = 'generic-service',
+ $notification_period = "24x7",
+ $max_check_attempts = 4,
+ $retry_check_interval = 1,
+ $notification_interval = 960,
+ $normal_check_interval = 5,
+ $check_period = "24x7",
+ $nagios_contact_groups_in = $nagios_contact_groups,
+ $service_description = 'absent')
+{
+
+ # this ensures nagios internal check, that every
+ # service has it's host
+ # temporary disabled.
+ # include nagios::target::host
+
+ $real_nagios_contact_groups = $nagios_contact_groups_in ? {
+ '' => 'admins',
+ default => $nagios_contact_groups_in
+ }
+ @@nagios_service {$name:
+ ensure => $ensure,
+ check_command => $check_command,
+ use => $use,
+ host_name => $host_name,
+ notification_period => $notification_period,
+ max_check_attempts => $max_check_attempts,
+ retry_check_interval => $retry_check_interval,
+ notification_interval => $notification_interval,
+ normal_check_interval => $normal_check_interval,
+ contact_groups => $real_nagios_contact_groups,
+ check_period => $check_period,
+ notify => Service[nagios],
+ }
+ case $service_description {
+ 'absent': {
+ Nagios_service[$name]{
+ service_description => $name,
+ }
+ }
+ default: {
+ Nagios_service[$name]{
+ service_description => $service_description,
+ }
+ }
+ }
+}
+