Puppet Class: collectd::plugin::libvirt

Defined in:
manifests/plugin/libvirt.pp

Overview

Parameters:

  • connection (Any)
  • ensure (Any) (defaults to: present)
  • refresh_interval (Any) (defaults to: undef)
  • domain (Any) (defaults to: undef)
  • block_device (Any) (defaults to: undef)
  • interface_device (Any) (defaults to: undef)
  • ignore_selected (Any) (defaults to: undef)
  • hostname_format (Any) (defaults to: undef)
  • interface_format (Any) (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
# File 'manifests/plugin/libvirt.pp', line 2

class collectd::plugin::libvirt (
  $connection,
  $ensure           = present,
  $refresh_interval = undef,
  $domain           = undef,
  $block_device     = undef,
  $interface_device = undef,
  $ignore_selected  = undef,
  $hostname_format  = undef,
  $interface_format = undef,
  $interval         = undef,
) {
  validate_string($connection)

  if $refresh_interval != undef { validate_re($refresh_interval, '^\d+$') }
  if $domain != undef           { validate_string($domain) }
  if $block_device != undef     { validate_string($block_device) }
  if $interface_device != undef { validate_string($interface_device) }
  if $ignore_selected != undef  { validate_bool($ignore_selected) }
  if $hostname_format != undef  { validate_string($hostname_format) }
  if $interface_format != undef { validate_string($interface_format) }

  if $::osfamily == 'RedHat' {
    package { 'collectd-virt':
      ensure => $ensure,
    }
  }

  collectd::plugin { 'libvirt':
    ensure   => $ensure,
    content  => template('collectd/plugin/libvirt.conf.erb'),
    interval => $interval,
  }
}