Permalink
Browse files

add define for service definition

  • Loading branch information...
saz committed Mar 26, 2012
1 parent 0436a4d commit 7f8a0dc7fd7e526f2038e43e80d0a3fbd228ae50
Showing with 25 additions and 0 deletions.
  1. +25 −0 manifests/service/service.pp
@@ -0,0 +1,25 @@
+define icinga::service::service(
+ $command,
+ $servicegroups = undef,
+ $host = $::fqdn,
+ $alias = $::hostname,
+ $append_name = false
+) {
+ include icinga::params
+
+ if $append_name == true {
+ $command_real = "${command}${name}"
+ } else {
+ $command_real = $command
+ }
+
+ @@nagios_service { "${host}_${name}":
+ ensure => present,
+ check_command => $command_real,
+ host_name => $alias,
+ servicegroups => $servicegroups,
+ service_description => $name,
+ use => 'generic-service',
+ target => "${icinga::params::objects_dir}services/${host}_${name}.cfg",
+ }
+}

0 comments on commit 7f8a0dc

Please sign in to comment.