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,
}
}
|