* Applied comments made by nickchappell. Fixed identation and few typos on README.md. Tabularize define parameters.
Signed-off-by: Nick Chappell <nick@intronic.org> Merged from: https://github.com/Icinga/puppet-icinga2/pull/36 refs#7216: https://dev.icinga.org/issues/7216
This commit is contained in:
parent
09db5bba18
commit
d02eae3b5b
2 changed files with 22 additions and 28 deletions
18
README.md
18
README.md
|
@ -560,17 +560,11 @@ The `notification` defined type can create `notification` objects.
|
||||||
<pre>
|
<pre>
|
||||||
#Defining Create the mail notification command:
|
#Defining Create the mail notification command:
|
||||||
icinga2::object::notification { 'localhost-ping-notification':
|
icinga2::object::notification { 'localhost-ping-notification':
|
||||||
|
host_name => 'localhost',
|
||||||
host_name = "localhost"
|
service_name => 'ping4',
|
||||||
|
command => 'mail-service-notification',
|
||||||
service_name = "ping4"
|
types => [ 'Problem', 'Recovery' ]
|
||||||
|
|
||||||
command = "mail-service-notification"
|
|
||||||
|
|
||||||
types = [ Problem, Recovery ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Available parameters are:
|
Available parameters are:
|
||||||
|
@ -593,9 +587,9 @@ Available parameters are:
|
||||||
|
|
||||||
Notes on specific parameters:
|
Notes on specific parameters:
|
||||||
|
|
||||||
* `vars`: needs to be a dictionary
|
* `vars`: needs to be a hash
|
||||||
* `users`,`user_groups`,`types`,`states`: should be an array, see [Notification](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notification) for list of valid state and type filters
|
* `users`,`user_groups`,`types`,`states`: should be an array, see [Notification](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notification) for list of valid state and type filters
|
||||||
* `times`: needs to be a dictionary with `begin` and `end` attributes
|
* `times`: needs to be a hash with `begin` and `end` attributes
|
||||||
* `interval`: needs to be a [number](https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#numbers), not a quoted string
|
* `interval`: needs to be a [number](https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#numbers), not a quoted string
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,22 +11,22 @@
|
||||||
|
|
||||||
define icinga2::object::notification (
|
define icinga2::object::notification (
|
||||||
$object_notificationname = $name,
|
$object_notificationname = $name,
|
||||||
$command = undef,
|
$command = undef,
|
||||||
$host_name = undef,
|
$host_name = undef,
|
||||||
$service_name = undef,
|
$service_name = undef,
|
||||||
$vars = {},
|
$vars = {},
|
||||||
$users = [],
|
$users = [],
|
||||||
$user_groups = [],
|
$user_groups = [],
|
||||||
$times = {},
|
$times = {},
|
||||||
$interval = undef,
|
$interval = undef,
|
||||||
$period = undef,
|
$period = undef,
|
||||||
$types = [],
|
$types = [],
|
||||||
$states = [],
|
$states = [],
|
||||||
$target_dir = '/etc/icinga2/objects/notifications',
|
$target_dir = '/etc/icinga2/objects/notifications',
|
||||||
$target_file_name = "${name}.conf",
|
$target_file_name = "${name}.conf",
|
||||||
$target_file_owner = 'root',
|
$target_file_owner = 'root',
|
||||||
$target_file_group = 'root',
|
$target_file_group = 'root',
|
||||||
$target_file_mode = '0644'
|
$target_file_mode = '0644'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
#Do some validation of the class' parameters:
|
#Do some validation of the class' parameters:
|
||||||
|
|
Loading…
Reference in a new issue