Skip to content

Instantly share code, notes, and snippets.

@guilhermeblanco
Created August 11, 2014 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermeblanco/7605f0895e3c5737f55c to your computer and use it in GitHub Desktop.
Save guilhermeblanco/7605f0895e3c5737f55c to your computer and use it in GitHub Desktop.
collectd::core_plugins:
'apache':
'apache80':
'URL': 'http://localhost/server-status?auto'
collectd::core_plugins:
'syslog': ~
'conntrack': ~
'contextswitch': ~
'entropy': ~
'load': ~
'memory': ~
'disk':
'Disk': '/^[vhs]d[a-f][0-9]?$/'
'IgnoreSelected': 'false'
'df':
'MountPoint': '/'
'interface':
'Interface': 'lo'
'IgnoreSelected': 'true'
---
:backends:
- yaml
:hierarchy:
- "%{::hostname}"
- "%{::environment}"
- apache
- common
:yaml:
:datadir: /etc/puppet/nodes
:merge_behavior: deeper
class collectd (
$core_plugins = undef,
$perl_plugins = undef
) {
# Hiera deep merge magic
if $core_plugins != undef {
$collectd_core_plugins = hiera_hash('collectd::core_plugins')
validate_hash($collectd_core_plugins)
}
if $perl_plugins != undef {
$collectd_perl_plugins = hiera_hash('collectd::perl_plugins')
validate_hash($collectd_perl_plugins)
}
# ... there's a template call that uses collectd_core_plugins and collectd_perl_plugins later here
}
# nothing here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment