forked from voxpupuli/puppet-collectd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create processtype configuration on RedHat
There was a name clash between: * Puppet created configuration file. * Package provided configuration file. Since a864d0d the collectd module on RedHat purges the package provided file file `/etc/collectd.d/processes-config.conf` The module was also creating this file with a concat and result was no file on system. To avoid the clash puppet now creates the file `processes_config.conf`. Note the `-` vs `_`. There is probably a cleaner fix to move all of the processes plugin configuration into the per module file `/etc/collect.d/10-processses.conf` as that would be more consistant with other simpler modules. This would be a change for every module however with `collectd::plugin` itself changing. Fixes voxpupuli#926
- Loading branch information
1 parent
940a7ad
commit a4cf5c6
Showing
6 changed files
with
114 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'collectd::plugin::processes::process' do | ||
context 'basic parameters' do | ||
# Using puppet_apply as a helper | ||
it 'works idempotently with no errors' do | ||
pp = <<-EOS | ||
class{'collectd': | ||
utils => true, | ||
} | ||
collectd::plugin::processes::process{'bar': | ||
collect_file_descriptor => true, | ||
} | ||
# Configure one write plugin to keep logs quiet | ||
class{'collectd::plugin::csv':} | ||
# Create a socket to query | ||
class{'collectd::plugin::unixsock': | ||
socketfile => '/var/run/collectd-sock', | ||
socketgroup => 'root', | ||
} | ||
EOS | ||
# Run 3 times since the collectd_version | ||
# fact is impossible until collectd is | ||
# installed. | ||
apply_manifest(pp, catch_failures: false) | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
# Wait to get some data | ||
shell('sleep 10') | ||
end | ||
|
||
describe service('collectd') do | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe command('collectdctl -s /var/run/collectd-sock listval') do | ||
its(:exit_status) { is_expected.to eq 0 } | ||
its(:stdout) { is_expected.to match %r{processcount-bar/ps_count} } | ||
end | ||
end | ||
end |
45 changes: 45 additions & 0 deletions
45
spec/acceptance/define_plugin_processes_processmatch_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'collectd::plugin::processes::processmatchs' do | ||
context 'basic parameters' do | ||
# Using puppet_apply as a helper | ||
it 'works idempotently with no errors' do | ||
pp = <<-EOS | ||
class{'collectd': | ||
utils => true, | ||
} | ||
# Configure one write plugin to keep logs quiet | ||
collectd::plugin::processes::processmatch{'foo': | ||
collect_file_descriptor => true, | ||
regex => 'foo .*$', | ||
} | ||
class{'collectd::plugin::csv':} | ||
# Create a socket to query | ||
class{'collectd::plugin::unixsock': | ||
socketfile => '/var/run/collectd-sock', | ||
socketgroup => 'root', | ||
} | ||
EOS | ||
# Run 3 times since the collectd_version | ||
# fact is impossible until collectd is | ||
# installed. | ||
apply_manifest(pp, catch_failures: false) | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
# Wait to get some data | ||
shell('sleep 10') | ||
end | ||
|
||
describe service('collectd') do | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe command('collectdctl -s /var/run/collectd-sock listval') do | ||
its(:exit_status) { is_expected.to eq 0 } | ||
its(:stdout) { is_expected.to match %r{processcount-foo/ps_count} } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters