Skip to content

Commit

Permalink
Merge pull request redhat-openstack#198 from ByteInternet/zfs_arc
Browse files Browse the repository at this point in the history
Add collectd::plugin::zfs_arc
  • Loading branch information
blkperl committed Dec 5, 2014
2 parents 0899e82 + 8d457c9 commit 8889605
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions manifests/plugin/zfs_arc.pp
Original file line number Diff line number Diff line change
@@ -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
}
}
34 changes: 34 additions & 0 deletions spec/classes/collectd_plugin_zfs_arc_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8889605

Please sign in to comment.