Skip to content

Commit

Permalink
notify client and/or server if enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed May 29, 2014
1 parent 2f22c28 commit 62d7c94
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion manifests/check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@
fail("sensu::check{${name}}: timeout must be a numeric (got: ${timeout})")
}

if $client {
if $server {
$notify = [ Class['sensu::client::service'], Class['sensu::server::service'] ]
} else {
$notify = Class['sensu::client::service']
}
} elsif $server {
$notify = Class['sensu::client::service']
} else {
$notify = []
}

$check_name = regsubst(regsubst($name, ' ', '_', 'G'), '[\(\)]', '', 'G')

file { "/etc/sensu/conf.d/checks/${check_name}.json":
Expand All @@ -116,7 +128,7 @@
publish => $publish,
custom => $custom,
require => File['/etc/sensu/conf.d/checks'],
notify => [ Class['sensu::client::service'], Class['sensu::server::service'] ],
notify => $notify,
}

}

0 comments on commit 62d7c94

Please sign in to comment.