From 8d457c958f631f646b49c3290dc0763f9936126c Mon Sep 17 00:00:00 2001 From: Nick Groenen Date: Wed, 3 Dec 2014 15:10:09 +0100 Subject: [PATCH] Add collectd::plugin::zfs_arc --- README.md | 9 ++++++ manifests/plugin/zfs_arc.pp | 8 +++++ spec/classes/collectd_plugin_zfs_arc_spec.rb | 34 ++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 manifests/plugin/zfs_arc.pp create mode 100644 spec/classes/collectd_plugin_zfs_arc_spec.rb diff --git a/README.md b/README.md index 8be672a69..bc08e6c81 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ documentation for each plugin for configurable attributes. * `write_http` (see [collectd::plugin::write_http](#class-collectdpluginwrite_http) below) * `write_network` (see [collectd::plugin::write_network](#class-collectdpluginwrite_network) below) * `write_riemann` (see [collectd::plugin::write_riemann](#class-collectdpluginwrite_riemann) below) +* `zfs_arc` (see [collectd::plugin::zfs_arc](#class-collectdpluginzfs_arc) below) ####Class: `collectd::plugin::amqp` @@ -793,6 +794,14 @@ class { 'collectd::plugin::write_riemann': } ``` + +####Class: `collectd::plugin::zfs_arc` + +```puppet +class { 'collectd::plugin::zfs_arc': +} +``` + ##Limitations See metadata.json for supported platforms diff --git a/manifests/plugin/zfs_arc.pp b/manifests/plugin/zfs_arc.pp new file mode 100644 index 000000000..1065e3cb6 --- /dev/null +++ b/manifests/plugin/zfs_arc.pp @@ -0,0 +1,8 @@ +# https://collectd.org/wiki/index.php/Plugin:ZFS_ARC +class collectd::plugin::zfs_arc ( + $ensure = present, +) { + collectd::plugin {'zfs_arc': + ensure => $ensure + } +} diff --git a/spec/classes/collectd_plugin_zfs_arc_spec.rb b/spec/classes/collectd_plugin_zfs_arc_spec.rb new file mode 100644 index 000000000..4fbcc2421 --- /dev/null +++ b/spec/classes/collectd_plugin_zfs_arc_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe 'collectd::plugin::zfs_arc', :type => :class do + + context ':ensure => present' do + let :facts do + {:osfamily => 'FreeBSD'} + end + it 'Will create 10-zfs_arc.conf' do + should contain_file('zfs_arc.load').with({ + :ensure => 'present', + :path => '/usr/local/etc/collectd/10-zfs_arc.conf', + :content => /\#\ Generated by Puppet\nLoadPlugin zfs_arc\n/, + }) + end + end + + context ':ensure => absent' do + let :facts do + {:osfamily => 'FreeBSD'} + end + let :params do + {:ensure => 'absent'} + end + + it 'Will not create 10-zfs_arc.conf' do + should contain_file('zfs_arc.load').with({ + :ensure => 'absent', + :path => '/usr/local/etc/collectd/10-zfs_arc.conf', + }) + end + end +end +