Defined Type: collectd::type

Defined in:
manifests/type.pp

Overview

Parameters:

  • target (Any)
  • ds_type (Any)
  • ds (Any) (defaults to: $title)
  • min (Any) (defaults to: 'U')
  • max (Any) (defaults to: 'U')
  • ds_name (Any) (defaults to: 'value')


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'manifests/type.pp', line 1

define collectd::type (
  $target,
  $ds_type,
  $ds = $title,
  $min = 'U',
  $max = 'U',
  $ds_name = 'value',
) {
  validate_string($ds_name)
  $upper_ds_type = upcase($ds_type)

  validate_re($upper_ds_type,
              ['^ABSOLUTE$', '^COUNTER$', '^DERIVE$', '^GAUGE$'])

  if $min != 'U' {
    validate_numeric($min)
  }

  if $max != 'U' {
    validate_numeric($max)
  }

  $content = "${ds}\t${ds_name}:${upper_ds_type}:${min}:${max}"

  concat::fragment { "${target}/${ds}":
    content => $content,
    target  => $target,
    order   => $ds,
  }
}