Module collectd
In: /home/david/repos/complete/modules/collectd/manifests/logfile.pp
/home/david/repos/complete/modules/collectd/manifests/plugin.pp
/home/david/repos/complete/modules/collectd/manifests/init.pp
/home/david/repos/complete/modules/collectd/manifests/syslog.pp
/home/david/repos/complete/modules/collectd/manifests/network.pp
/home/david/repos/complete/modules/collectd/manifests/conf.pp
/home/david/repos/complete/modules/collectd/manifests/libdir.pp
/home/david/repos/complete/modules/collectd/plugins/puppet/provider/collectd_threshold/parsed.rb
/home/david/repos/complete/modules/collectd/plugins/puppet/provider/collectd_conf/parsed.rb
/home/david/repos/complete/modules/collectd/plugins/puppet/parser/functions/join.rb
/home/david/repos/complete/modules/collectd/plugins/puppet/type/collectd_conf.rb
/home/david/repos/complete/modules/collectd/plugins/puppet/type/collectd_threshold.rb

Thanks

Work on this module was made possible by funding from neoTactics, Inc.

                     http://neotactics.com/

Collectd

==

Collectd is a very lightweight system statistics gathering daemon. To quote from collectd.org/ :

> […] it‘s written in C for performance and portability, […] It includes > optimizations and features to handle hundreds of thousands of data sets. It > comes with over 60 plugins […]. It provides powerful networking features > and is extensible in numerous ways. Last but not least: collectd is actively > developed and supported and well documented.

The Module

====

The collectd puppet module contains high-level defines to configure the most important modules as well as native puppet types to manage the configuration files as well as collectd‘s notification and threshold rules.

The mapping tries to use collectd‘s config file keywords as much as possible. Therefore any know-how should carry over pretty straight forward.

You can find the module at git.black.co.at/?p=module-collectd

Please send any patches and comments to this list for discussion.

Caveats

=
  1. Due to the heterogeneous syntax of collectd‘s configuration files, I opted

to split the Key-Value-style configuration of the daemon itself and the sections for the plugins into different native types. This in turn necessitates to have each plugin configuration in a separate file. The default "collectd" class in the module will setup the proper structures to automatically create the default locations and include them into the daemon‘s configuration.

  1. There are currently only a few plugins explicitly implemented. To implement

a new plugin configuration, one just needs to specify a mapping from puppet resources’ parameters to the actual configuration, which is really straight forward using the provided infrastructure.

Defines

conf   libdir   logfile   network   plugin   syslog  

Plugins

join   collectd_conf   collectd_threshold  

Classes and Modules

Class collectd::collectd

Defines

conf( $value, $quote => '', $ensure => 'present' )

Define: collectd::conf

Parameters:

  namevar       - the name of the collect.conf option
  value - the value to set for this option. Use an array to specify
                  multiple values, these will be put on separate lines
  ensure        - 'present' or 'absent'
  quote - specify whether the value needs quoting. A default is chosen
                  for known options, if nothing is specified.
libdir( )

private, a purged directory to store the various additional configs

logfile( $timestamp => 'true', $level )

Define: collectd::logfile specifies a logfile for collectd

Parameters:

  namevar       - The basename for the logfile. It'll actually be called "/var/log/collectd_${namevar}.log"
  level - The collectd loglevel
  timestamp     - 'true' (default) or 'false'; whether to add timestamps to the log
network( $ttl => '', $forward => 'false', $server => '', $cache_flush => '1800', $listen => '' )

Define: collectd::network manage the network plugin‘s parameters

Parameters:

  namevar       - ignored, there can only be one network plugin specification per node
  listen        - The Listen statement's values. Can be an array for multiple interfaces.
  server        - The Server statement's values. Can be an array for multiple interfaces.
  ttl           - 1-255; set the time-to-live of sent packets.
  forward       - 'true' or 'false' (default); If set to true, write packets
                  that were received via the network plugin to the sending sockets.
  cache_flush   - seconds, (default=1800); how often the network plugin should
                  flush it's caches. Since this process is somewhat expensive
                  and normally doesn't do much, this value should not be too
                  small.  The default is 1800 seconds, but setting this to
                  86400 seconds (one day) will not do much harm either.
plugin( $lines => '' )

Define: collectd::plugin A generic wrapper for a plugin configuration. This automatically loads the plugin before it‘s configuration and notifies the collectd service to reload its configs.

Parameters:

  namevar       - The plugin to configure.
  lines - an array of lines to configure the plugin.
syslog( )

Define: collectd::syslog A shortcut to specifying the syslog log level. This can be used only once per node.

Parameters:

  namevar       - the lowest loglevel which should be sent to syslog

[Validate]