Skip to content

egouraud/genebean-nxlog

 
 

Repository files navigation

Build Status Puppet Forge GitHub tag

nxlog

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with nxlog
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

This module manages NXLog. It is primarily targeted at Windows but should work on Linux too so long as the package is available via some repository. Automated testing is done via Travis CI and tests against both Puppet 3.x and 4.x.

Module Description

This module installs the nxlog package, builds a config file using puppetlabs-concat, and manages the nxlog service. Since the config file for NXLog is broken up into sections, and most of these can be repeated, the choice was made to utilize defined types similar to the way the Apache module does with virtual hosts.

Setup

What nxlog affects

  • nxlog package
  • nxlog config file
  • nxlog service

Beginning with nxlog

This is an example of how to build a full config file:

class {'nxlog':
	conf_dir       => 'C:\Program Files (x86)\nxlog\conf',
	conf_file      => 'nxlog.conf',
  ensure_setting => latest,
	nxlog_root     => 'C:\Program Files (x86)\nxlog',
}

nxlog::config::extension { 'json':
	ext_module => 'xm_json',
}

nxlog::config::input { 'eventlog_json':
	input_execs  => [
    'delete($Keywords)',
		'$raw_event = to_json()',
	],
	input_module => 'im_msvistalog',
}

nxlog::config::output { 'local_json':
	output_file_path => 'C:\eventlog-json.txt',
	output_module    => 'om_file',
}

nxlog::config::output { 'logserver':
	output_address   => 'logserver.example.com',
	output_module    => 'om_udp',
	output_port      => '6371',
}

nxlog::config::route { 'local':
	route_destination => [ 'local_json', ],
  route_source      => [ 'eventlog_json', ],
}

nxlog::config::route { 'logserver':
	route_destination => [ 'logserver', ],
  route_source      => [ 'eventlog_json', ],
}

Usage

Class nxlog

These settings are used both in the config file and by the other parts of the module.

conf_dir - the directory where nxlog.conf resides

conf_file - the name of the config file

ensure_setting - this is passed to the package resource

nxlog_root - the installation directory for the nxlog program.

Defined Types

Each of these builds a section of the config file.

nxlog::config::extension - builds an Extension section using the specified name.

  • ext_module - the name of the extension module to use

nxlog::config::input - builds an Input section using the specified name.

  • input_execs - an array of Exec statements to include (Optional)
  • input_module - the name of the input module to use

nxlog::config::output - builds an Output section using the specified name.

  • output_address - the address of the remote host to send data to
  • output_file_path - defines the path to use if writing to a local file
  • output_module - the name of the output module to use
  • output_port - the port on the remote host to send data to

nxlog::config::route - builds a Route section using the specified name.

  • route_destination - an array of outputs to send data to
  • route_source - an array of inputs to send to the named destination

Limitations

On Windows it is assumed that you are using Chocolatey to install packages.

On Linux it is assumed that you have a custom repo with the installer available within.

Development

Pull requests are welcome! A Vagrantfile is included in this module to aide in testing and development. All code must have tests before it will be merged but I am happy to help with that part.

About

A Puppet module to manage NXLog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 64.8%
  • Puppet 28.6%
  • HTML 6.5%
  • Pascal 0.1%