Defined Type: icinga2::object::checkresultreader

Defined in:
manifests/object/checkresultreader.pp

Overview

Parameters:

  • ensure (Enum['absent', 'present']) (defaults to: present)

    Set to present enables the object, absent disables it.

  • checkresultreader_name (String) (defaults to: $title)

    Set the Icinga 2 name of the ceckresultreader object.

  • spool_dir (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    The directory which contains the check result files.

  • target (Stdlib::Absolutepath)

    Destination config file to store in this object. File will be declared the first time.

  • order (Variant[String, Integer]) (defaults to: '05')

    String or integer to set the position in the target file, sorted alpha numeric.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'manifests/object/checkresultreader.pp', line 20

define icinga2::object::checkresultreader (
  Stdlib::Absolutepath               $target,
  Enum['absent', 'present']          $ensure                 = present,
  String                             $checkresultreader_name = $title,
  Optional[Stdlib::Absolutepath]     $spool_dir              = undef,
  Variant[String, Integer]           $order                  = '05',
){

  # compose the attributes
  $attrs = {
    'spool_dir'   => $spool_dir,
  }

  # create object
  icinga2::object { "icinga2::object::CheckResultReader::${title}":
    ensure      => $ensure,
    object_name => $checkresultreader_name,
    object_type => 'CheckResultReader',
    attrs       => delete_undef_values($attrs),
    attrs_list  => keys($attrs),
    target      => $target,
    order       => $order,
  }

  # import library
  concat::fragment { "icinga2::object::CheckResultReader::${title}-library":
    target  => $target,
    content => "library \"compat\"\n\n",
    order   => $order,
  }
}