Puppet Class: ulogd

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

Summary

Set up and configure ulogd2

Overview

SPDX-License-Identifier: Apache-2.0 If true sync all disk writes to disk immediately

Parameters:

  • logfile (Ulogd::Logfile) (defaults to: 'syslog')

    Where to send the daemon [i.e. not the NFLOG] logs options are syslog, stdout, stderr or a file path

  • log_level (Wmflib::Syslog::Level::Unix) (defaults to: 'info')

    The logging level for ulogd logs

  • logemu_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/syslogemu.log')

    file to use for LOGEM output

  • logemu_nfct_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/syslogemu_nfct.log')

    file to use for LOGEM nfct output

  • oprint_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/oprint.log')

    file to use for OPRIN output

  • gprint_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/gprint.log')

    file to use for GPRIN output

  • xml_directory (Stdlib::Unixpath) (defaults to: '/var/log/ulog/')

    file to use for xml files

  • json_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd.json')

    file to use for json output

  • json_nfct_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd_nfct.json')

    file to use for json nfct output

  • pcap_file (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd.pcap')

    file to use for libpcap output

  • nacct_file (Stdlib::Unixpath) (defaults to: '/var/log/ulog/nacct.log')

    file to use for nacct output

  • config_file (Stdlib::Unixpath) (defaults to: '/etc/ulogd.conf')

    location of the main config file

  • syslog_facility (Ulogd::Facility) (defaults to: 'local7')

    facility to use with syslog extension

  • syslog_level (Wmflib::Syslog::Level::Unix) (defaults to: 'info')

    log level to use with syslog extension

  • sync (Boolean) (defaults to: true)
  • nflog (Array[Ulogd::Output]) (defaults to: ['SYSLOG'])

    outputters to use for NFLOG

  • nfct (Array[Ulogd::Output]) (defaults to: [])

    outputters to use for NFCT

  • acct (Array[Ulogd::Output]) (defaults to: [])

    outputters to use for NACCT



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
83
84
# File 'modules/ulogd/manifests/init.pp', line 42

class ulogd (
  Ulogd::Logfile              $logfile             = 'syslog',
  Wmflib::Syslog::Level::Unix $log_level           = 'info',
  Stdlib::Unixpath            $logemu_logfile      = '/var/log/ulog/syslogemu.log',
  Stdlib::Unixpath            $logemu_nfct_logfile = '/var/log/ulog/syslogemu_nfct.log',
  Stdlib::Unixpath            $oprint_logfile      = '/var/log/ulog/oprint.log',
  Stdlib::Unixpath            $gprint_logfile      = '/var/log/ulog/gprint.log',
  Stdlib::Unixpath            $xml_directory       = '/var/log/ulog/',
  Stdlib::Unixpath            $json_logfile        = '/var/log/ulog/ulogd.json',
  Stdlib::Unixpath            $json_nfct_logfile   = '/var/log/ulog/ulogd_nfct.json',
  Stdlib::Unixpath            $pcap_file           = '/var/log/ulog/ulogd.pcap',
  Stdlib::Unixpath            $nacct_file          = '/var/log/ulog/nacct.log',
  Stdlib::Unixpath            $config_file         = '/etc/ulogd.conf',
  Ulogd::Facility             $syslog_facility     = 'local7',
  Wmflib::Syslog::Level::Unix $syslog_level        = 'info',
  Boolean                     $sync                = true,
  Array[Ulogd::Output]        $nflog               = ['SYSLOG'],
  Array[Ulogd::Output]        $nfct                = [],
  Array[Ulogd::Output]        $acct                = [],
) {
  # An array of supported extensions that require additional packages
  # dbi, mysql, pgsql and sqlite are options for the future
  $supported_extensions = ['JSON', 'PCAP']
  ensure_packages('ulogd2')

  $supported_extensions.each |String $extension| {
    if $extension in union($nflog, $nfct, $acct)  {
      ensure_packages("ulogd2-${extension.downcase}")
    }
  }
  file {$config_file:
    ensure  => file,
    content => template('ulogd/etc/ulogd.conf.erb'),
    notify  => Service['ulogd2'],
  }
  service {'ulogd2':
    ensure  => 'running',
    enable  => true,
    require => Package['ulogd2'],
  }

  profile::auto_restarts::service { 'ulogd2': }
}