Skip to content

Commit 8d457c9

Browse files
committed
Add collectd::plugin::zfs_arc
1 parent 4fa9f16 commit 8d457c9

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ documentation for each plugin for configurable attributes.
105105
* `write_http` (see [collectd::plugin::write_http](#class-collectdpluginwrite_http) below)
106106
* `write_network` (see [collectd::plugin::write_network](#class-collectdpluginwrite_network) below)
107107
* `write_riemann` (see [collectd::plugin::write_riemann](#class-collectdpluginwrite_riemann) below)
108+
* `zfs_arc` (see [collectd::plugin::zfs_arc](#class-collectdpluginzfs_arc) below)
108109

109110
####Class: `collectd::plugin::amqp`
110111

@@ -793,6 +794,14 @@ class { 'collectd::plugin::write_riemann':
793794
}
794795
```
795796

797+
798+
####Class: `collectd::plugin::zfs_arc`
799+
800+
```puppet
801+
class { 'collectd::plugin::zfs_arc':
802+
}
803+
```
804+
796805
##Limitations
797806

798807
See metadata.json for supported platforms

manifests/plugin/zfs_arc.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://collectd.org/wiki/index.php/Plugin:ZFS_ARC
2+
class collectd::plugin::zfs_arc (
3+
$ensure = present,
4+
) {
5+
collectd::plugin {'zfs_arc':
6+
ensure => $ensure
7+
}
8+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
require 'spec_helper'
2+
3+
describe 'collectd::plugin::zfs_arc', :type => :class do
4+
5+
context ':ensure => present' do
6+
let :facts do
7+
{:osfamily => 'FreeBSD'}
8+
end
9+
it 'Will create 10-zfs_arc.conf' do
10+
should contain_file('zfs_arc.load').with({
11+
:ensure => 'present',
12+
:path => '/usr/local/etc/collectd/10-zfs_arc.conf',
13+
:content => /\#\ Generated by Puppet\nLoadPlugin zfs_arc\n/,
14+
})
15+
end
16+
end
17+
18+
context ':ensure => absent' do
19+
let :facts do
20+
{:osfamily => 'FreeBSD'}
21+
end
22+
let :params do
23+
{:ensure => 'absent'}
24+
end
25+
26+
it 'Will not create 10-zfs_arc.conf' do
27+
should contain_file('zfs_arc.load').with({
28+
:ensure => 'absent',
29+
:path => '/usr/local/etc/collectd/10-zfs_arc.conf',
30+
})
31+
end
32+
end
33+
end
34+

0 commit comments

Comments
 (0)