Skip to content

Commit

Permalink
fix #464 Rework param data types of icinga2::feature::statusdata
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Sep 14, 2018
1 parent d759dde commit 3eafa1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1103,18 +1103,18 @@ Enables or disables the `statusdata` feature.
Either `present` or `absent`. Defines if the feature `statusdata` should be enabled. Defaults to `present`.

##### `status_path`
Absolute path to the status.dat file. Default depends on platform:
Absolute path to the status.dat file. Defaults depend on platform:
* Linux: `/var/cache/icinga2/status.dat`
* Windows: `C:/ProgramData/icinga2/var/cache/icinga2/status.dat`

##### `object_path`
Absolute path to the object.cache file. Default depends on platform:
Absolute path to the object.cache file. Defaults depend on platform:
* Linux: `/var/cache/icinga2/object.cache`
* Windows: `C:/ProgramData/icinga2/var/cache/icinga2/object.cache`

##### `update_interval`
Interval in seconds to update both status files. You can also specify it in minutes with the letter m or in seconds
with s. Defaults to `30s`
with s. Icinga defaults to `15s`

#### Class: `icinga2::feature::syslog`
Enables or disables the `syslog` feature.
Expand Down
17 changes: 9 additions & 8 deletions manifests/feature/statusdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
# Set to present enables the feature statusdata, absent disables it. Defaults to present.
#
# [*status_path*]
# Absolute path to the status.dat file. Default depends on platform:
# Absolute path to the status.dat file. Defaults depend on platform:
# /var/cache/icinga2/status.dat on Linux
# C:/ProgramData/icinga2/var/cache/icinga2/status.dat on Windows
#
# [*object_path*]
# Absolute path to the object.cache file. Default depends on platform:
# Absolute path to the object.cache file. Defaults depend on platform:
# /var/cache/icinga2/object.cache on Linux
# C:/ProgramData/icinga2/var/cache/icinga2/object.cache on Windows
#
# [*update_interval*]
# Interval in seconds to update both status files.
# You can also specify it in minutes with the letter m or in seconds with s. Defaults to '15s'
# Interval in seconds to update both status files. You can also specify
# it in minutes with the letter m or in seconds with s.
# Icinga defaults to '15s'
#
#
class icinga2::feature::statusdata(
Enum['absent', 'present'] $ensure = present,
Stdlib::Absolutepath $status_path = "${::icinga2::params::cache_dir}/status.dat",
Stdlib::Absolutepath $objects_path = "${::icinga2::params::cache_dir}/objects.cache",
Pattern[/^\d+[ms]*$/] $update_interval = '15s',
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Absolutepath] $status_path = undef,
Optiona[Stdlib::Absolutepath] $objects_path = undef,
Optiona[Pattern[/^\d+[ms]*$/]] $update_interval = undef,
) {

if ! defined(Class['::icinga2']) {
Expand Down

0 comments on commit 3eafa1d

Please sign in to comment.