Skip to content

Commit

Permalink
Merge pull request #622 from EmpaticoOrg/threshold_plugin
Browse files Browse the repository at this point in the history
Added base threshold plugin
  • Loading branch information
rnelson0 committed Jan 11, 2017
2 parents 6f9e2ff + 86b69ae commit 2e4e746
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ documentation for each plugin for configurable attributes.
below)
* `tcpconns` (see [collectd::plugin::tcpconns](#class-collectdplugintcpconns) below)
* `thermal` (see [collectd::plugin::thermal](#class-collectdpluginthermal) below)
* `threshold` (see [collect::plugin::threshold](#class-collectdpluginthreshold) below)
* `unixsock` (see [collectd::plugin::unixsock](#class-collectdpluginunixsock) below)
* `uptime` (see [collectd::plugin::uptime](#class-collectdpluginuptime) below)
* `users` (see [collectd::plugin::users](#class-collectdpluginusers) below)
Expand Down Expand Up @@ -1568,6 +1569,13 @@ class { '::collectd::plugin::thermal':
}
```

#### Class: `collectd::plugin::threshold`

```puppet
class { 'collectd::plugin::threshold':
}
```

####Class: `collectd::plugin::unixsock`

```puppet
Expand Down
13 changes: 13 additions & 0 deletions manifests/plugin/threshold.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_threshold
class collectd::plugin::threshold (
$ensure = 'present',
$interval = undef,
) {

include ::collectd

collectd::plugin { 'threshold':
ensure => $ensure,
interval => $interval,
}
}
27 changes: 27 additions & 0 deletions spec/classes/collectd_plugin_threshold_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'spec_helper'

describe 'collectd::plugin::threshold', type: :class do
let :facts do
{
osfamily: 'Debian',
concat_basedir: '/dne',
id: 'root',
kernel: 'Linux',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
collectd_version: '5.0',
operatingsystemmajrelease: '7',
python_dir: '/usr/local/lib/python2.7/dist-packages'
}
end

context ':ensure => present' do
context ':ensure => present and default parameters' do
it 'Will create /etc/collectd/conf.d/10-threshold.conf to load the plugin' do
is_expected.to contain_file('threshold.load').
with(ensure: 'present',
path: '/etc/collectd/conf.d/10-threshold.conf',
content: %r{LoadPlugin threshold})
end
end
end
end

0 comments on commit 2e4e746

Please sign in to comment.