Puppet Class: collectd::plugin::virt

Defined in:
manifests/plugin/virt.pp

Overview

Parameters:

  • connection (String)
  • ensure (Any) (defaults to: 'present')
  • manage_package (Any) (defaults to: undef)
  • refresh_interval (Optional[Pattern[/^\d+$/]]) (defaults to: undef)
  • domain (Optional[String]) (defaults to: undef)
  • block_device (Optional[String]) (defaults to: undef)
  • interface_device (Optional[String]) (defaults to: undef)
  • ignore_selected (Optional[Boolean]) (defaults to: undef)
  • plugin_instance_format (Optional[String[1]]) (defaults to: undef)
  • hostname_format (Optional[String]) (defaults to: undef)
  • interface_format (Optional[String]) (defaults to: undef)
  • extra_stats (Optional[String]) (defaults to: undef)
  • interval (Any) (defaults to: undef)


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