Puppet Class: ulogd

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

Overview

Class ulogd

Set up and configure ulogd2

Parameters:

logfile

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

log_level

The logging level for ulogd logs

logemu_logfile

file to use for LOGEM output

oprint_logfile

file to use for OPRIN output

gprint_logfile

file to use for GPRIN output

xml_directory

file to use for xml files

json_logfile

file to use for json output

pcap_file

to use for cwlibpcap output

config_file

location of the main config file

syslog_facility

facility to use with syslog extension

syslog_level

log level to use with syslog extension

sync

If true sync all disk writes to disk immediately

nflog

outputters to use for NFLOG

nfct

outputters to use for NFCT

acct

outputters to use for NACCT

Parameters:

  • logfile (Ulogd::Logfile) (defaults to: 'syslog')
  • log_level (Ulogd::Loglevel) (defaults to: 'info')
  • logemu_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/syslogemu.log')
  • logemu_nfct_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/syslogemu_nfct.log')
  • oprint_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/oprint.log')
  • gprint_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/gprint.log')
  • xml_directory (Stdlib::Unixpath) (defaults to: '/var/log/ulog/')
  • json_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd.json')
  • json_nfct_logfile (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd_nfct.json')
  • pcap_file (Stdlib::Unixpath) (defaults to: '/var/log/ulog/ulogd.pcap')
  • nacct_file (Stdlib::Unixpath) (defaults to: '/var/log/ulog/nacct.log')
  • config_file (Stdlib::Unixpath) (defaults to: '/etc/ulogd.conf')
  • syslog_facility (Ulogd::Facility) (defaults to: 'local7')
  • syslog_level (Ulogd::Loglevel) (defaults to: 'info')
  • sync (Boolean) (defaults to: true)
  • nflog (Array[Ulogd::Output]) (defaults to: ['SYSLOG'])
  • nfct (Array[Ulogd::Output]) (defaults to: [])
  • acct (Array[Ulogd::Output]) (defaults to: [])


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
85
86
87
88
89
90
91
# File 'modules/ulogd/manifests/init.pp', line 52

class ulogd (
  Ulogd::Logfile       $logfile             = 'syslog',
  Ulogd::Loglevel      $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',
  Ulogd::Loglevel      $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']
  require_package('ulogd2')

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