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
31
32
33
34
35
36
37
38
39
40
41
|
# File 'manifests/plugin/virt.pp', line 2
class collectd::plugin::virt (
String $connection,
$ensure = 'present',
$manage_package = undef,
Optional[Pattern[/^\d+$/]] $refresh_interval = undef,
Optional[String] $domain = undef,
Optional[String] $block_device = undef,
Optional[String] $interface_device = undef,
Optional[Boolean] $ignore_selected = undef,
Optional[String[1]] $plugin_instance_format = undef,
Optional[String] $hostname_format = undef,
Optional[String] $interface_format = undef,
Optional[String] $extra_stats = undef,
$interval = undef,
) {
include collectd
$_manage_package = pick($manage_package, $collectd::manage_package)
if $facts['os']['family'] == 'RedHat' {
if $_manage_package {
package { 'collectd-virt':
ensure => $ensure,
}
}
}
if versioncmp("${collectd::collectd_version_real}", '5.5') >= 0 { # lint:ignore:only_variable_string
$plugin_name = 'virt'
} else {
$plugin_name = 'libvirt'
}
collectd::plugin { 'virt':
ensure => $ensure,
name => $plugin_name,
content => template('collectd/plugin/virt.conf.erb'),
interval => $interval,
}
}
|