Puppet Class: pmacct

Defined in:
modules/pmacct/manifests/init.pp

Overview

Class: pmacct

Install and manage pmacct, www.pmacct.net/

Parameters

[*kafka_brokers*]
  List of Kafka Brokers hostname:port combination to contact.
  Default: undef

[*librdkafka_config*]
  List of librdkafka configs settings specified in the format indicated by upstream:

  topic, settingX, valueX
  global, settingY, valueY

  Only available for pmacct >= 1.6.2, otherwise the configuration is a no-op.
  Default: undef

[*networks*]
  List of networks to use to  differentiate in/out traffic
  Default: []
  Optional

[*rcvbuf_size*]
  Size in bytes of the socket receive buffer for UDP traffic. You will see drops if too small.
  Default: 20 MiByte
  Optional

Parameters:

  • kafka_brokers (Any) (defaults to: undef)
  • librdkafka_config (Any) (defaults to: undef)
  • networks (Optional[Array[Stdlib::IP::Address]]) (defaults to: [])
  • rcvbuf_size (Integer) (defaults to: *)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'modules/pmacct/manifests/init.pp', line 29

class pmacct(
  $kafka_brokers     = undef,
  $librdkafka_config = undef,
  Optional[Array[Stdlib::IP::Address]] $networks = [],
  Integer $rcvbuf_size = 20*1024*1024,
) {
    package { 'pmacct':
        ensure => present,
    }

    # Valid only when librdkafka_config is not undef
    $kafka_config_file = '/etc/pmacct/librdkafka.conf'

    file { '/etc/pmacct/pretag.map':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0440',
        content => template('pmacct/pretag.map.erb'),
        before  => File['/etc/pmacct/nfacctd.conf'],
    }

    file { '/etc/pmacct/nfacctd.conf':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0440',
        content => template('pmacct/nfacctd.conf.erb'),
        require => Package['pmacct'],
        before  => Service['nfacctd'],
        notify  => Service['nfacctd'],
    }

    if $librdkafka_config != undef {
        file { $kafka_config_file:
            ensure  => present,
            owner   => 'root',
            group   => 'root',
            mode    => '0440',
            content => template('pmacct/librdkafka.conf.erb'),
            require => Package['pmacct'],
            before  => Service['nfacctd'],
            notify  => Service['nfacctd'],
        }
    }

    service { 'nfacctd':
        ensure => running,
        enable => true,
    }

    base::service_auto_restart { 'nfacctd': }
    base::service_auto_restart { 'pmacctd': }
}