Version information
Start using this module
Add this module to your Puppetfile:
mod 'pdxcat-collectd', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
Collectd module for Puppet
Description
Puppet module for configuring collectd and plugins.
Usage
The simplest use case is to use all of the configurations in the default collectd.conf file shipped with collectd. This can be done by simply including the class:
include collectd
Collectd is most useful when configured with customized plugins. This is accomplished by removing the default collectd.conf file and replacing it with a file that includes all alternative configurations. Configure a node with the following class declaration:
class { '::collectd':
purge => true,
recurse => true,
purge_config => true,
}
Set purge, recurse, and purge_config to true in order to override the default configurations shipped in collectd.conf and use custom configurations stored in conf.d. From here you can set up additional plugins as shown below.
Simple Plugins
Example of how to load plugins with no additional configuration:
collectd::plugin { 'battery': }
where 'battery' is the name of the plugin.
Configurable Plugins
Parameters will vary widely between plugins. See the collectd documentation for each plugin for configurable attributes.
apache
(see collectd::plugin::apache below)bind
curl_json
(see collectd::plugin::curl_json below)df
(see collectd::plugin::df below)disk
(see collectd::plugin::disk below)filecount
(see collectd::plugin::filecount below)interface
iptables
irq
memcached
(see collectd::plugin::memcached below )mysql
(see collectd::plugin::mysql below)network
nginx
ntpd
(see collectd::plugin::ntpd below)openvpn
(see collectd::plugin::openvpn below)snmp
(see collectd::plugin::snmp below)syslog
(see collectd::plugin::sylog below)tcpconns
(see collectd::plugin::tcpconns below)unixsock
(see collectd::plugin::unixsock below)write_graphite
(see collectd::plugin::write_graphite below)write_network
(see collectd::plugin::write_network below)
####Class: collectd::plugin::apache
class { 'collectd::plugin::apache':
instances => {
'apache80' => {
'url' => 'http://localhost/mod_status?auto', 'user' => 'collectd', 'password' => 'hoh2Coo6'
},
'lighttpd8080' => {
'url' => 'http://localhost:8080/mod_status?auto'
}
},
}
####Class: collectd::plugin::curl_json
collectd::plugin::curl_json {
'rabbitmq_overview':
url => 'http://localhost:55672/api/overview',
instance => 'rabbitmq_overview',
keys => {
'message_stats/publish' => {'type' => 'gauge'},
}
}
####Class: collectd::plugin::df
class { 'collectd::plugin::df':
mountpoints => ['/u'],
fstypes => ['nfs','tmpfs','autofs','gpfs','proc','devpts'],
ignoreselected => 'true',
}
####Class: collectd::plugin::disk
class { 'collectd::plugin::disk':
disks => ['/^dm/'],
ignoreselected => 'true'
}
####Class: collectd::plugin::filecount
class { 'collectd::plugin::filecount':
directories => {
'active' => '/var/spool/postfix/active',
'incoming' => '/var/spool/postfix/incoming'
},
}
####Class: collectd::plugin::memcached
class { 'collectd::plugin::memcached':
host => '192.168.122.1',
port => '11211',
}
####Class: collectd::plugin::mysql
class { 'collectd::plugin::mysql':
database => 'betadase',
host => 'localhost',
username => 'stahmna',
password => 'secret',
port => '3306',
}
####Class: collectd::plugin::ntpd
class { 'collectd::plugin::ntpd':
host => 'localhost',
port => '123',
reverselookups => 'false',
includeunitid => 'false',
}
####Class: collectd::plugin::openvpn
class { 'collectd::plugin::openvpn':
collectindividualusers => 'false',
collectusercount => 'true',
}
####Class: collectd::plugin::snmp
class {'collectd::plugin::snmp':
data => {
amavis_incoming_messages => {
'Type' => 'counter',
'Table' => false,
'Instance' => 'amavis.inMsgs',
'Values' => ['AMAVIS-MIB::inMsgs.0']
}
},
hosts => {
debianvm => {
'Address' => '127.0.0.1',
'Version' => 2,
'Community' => 'public',
'Collect' => ['amavis_incoming_messages'],
'Interval' => 10
}
},
}
####Class: collectd::plugin::syslog
class { 'collectd::plugin::syslog':
log_level => 'warning'
}
####Class: collectd::plugin::tcpconns
class { 'collectd::plugin::tcpconns':
localports => ['25', '12026'],
remoteports => ['25'],
listening => false,
}
####Class: collectd::plugin::unixsock
class {'collectd::plugin::unixsock':
socketfile => '/var/run/collectd-sock',
socketgroup => 'nagios',
}
####Class: collectd::plugin::write_graphite
class { 'collectd::plugin::write_graphite':
graphitehost => 'graphite.examle.org',
}
####Class: collectd::plugin::write_network
class { 'collectd::plugin::write_network':
servers => {
'collect1.example.org' => { 'serverport' => '25826' },
'collect2.example.org' => { 'serverport' => '25826' }
}
}
##Limitations
This module has been tested on Ubuntu Precise, CentOS 5/6, Solaris 10, and Debian 6/7.
##Development
Running tests
This project contains tests for both rspec-puppet and rspec-system to verify functionality. For in-depth information please see their respective documentation.
Quickstart:
gem install bundler
bundle install
bundle exec rake spec
bundle exec rake spec:system
2013-09-27 Release 0.1.0
Summary:
Add curl_json and apache plugin
Backwards-incompatible changes:
- The write_network plugin now accepts a hash of servers
Features:
- Add curl_json plugin
- Added collectd package version parameter
- Add apache plugin
0.0.5 - pdxcat/collectd - 2013/09/24
6adca9a add ntpd plugin ab55fb4 Added tcpconns plugin and example for it in README 677ff72 Adding a new generic write_network plugin define 8cdd8b7 Added memcached plugin and example for it in README c3e4a02 Added examples to README for filecount, SNMP and unixsock f798c84 Added support for file count plugin 66f7392 Added support for SNMP and bumped stdlib dependency version to 3.0.0 7118450 Added support for unix socket plugin a062b11 Fixed source URL 1b214a2 Add testing docs to README
0.0.4 - pdxcat/collectd - 2013/08/26
9f3f0f6 Add bind plugin to readme f052087 Add bind plugin fc0c4c1 Add basic rspec-system test 0b2ec92 Fix README formatting issues 71dcad0 Add configurable plugins to the README 72b9f17 Add test for file_line 7eae468 Add buildstatus to the README b2cb208 Add travis.yml file 8cc16a8 Add purge_config enabled test 26683f0 Add spec test for collectd class 3f30650 Add spec helper files 0bee1d7 Add nginx plugin e2d558a Fix network plugin config syntax 79d8a68 Add network plugin c1085d7 Merge pull request #5 from agenticarus/newer-stdlib 88678bf Depend on newer version of stdlib 7dd9aaa added colorz to the README 628ed78 Added configuration for StoreRates and Port.
0.0.3 - pdxcat/collectd - 2013/05/27
f51660f Fixed test for collectd::plugin::irq 3019516 Added default field in selector for making syntax checkers happy. 39859e7 Added stdlib dependency for file_line
0.0.2 - pdxcat/collectd - 2013/05/09
185e16f Modifications for following puppetlabs style guide and add smoke tests for interface, irq and iptables d68275f Added interface, irq and iptables support. Untested though. b8312cc Added use of scope.lookupvar, allow configuration of threads and option to choose between hostname and fqdn
0.0.1 - pdxcat/collectd - 2013/02/06
8c64104 Add interval and timeout parameters e48288d Add redhat support to the collectd module. b6e3649 Add readme, module, and license files to collectd module. fb6b92f Fix bug in collectd::plugin define 4096cca Add purge_config option to collectd class 2a2974c Add purge option to collectd class 8acbef3 Add syslog plugin 137c919 Add ensure option for collectd::plugin 3406430 Fix plugins with wrong metaparams 315af94 Add collectd::plugin define for unconfigured plugins c085ebc Change include plugin file to include conf.d 171bddd Template openvpn plugin and parameterize the class 09c4df5 Add mysql plugin to collectd. 36f3465 Add disk plugin to collectd. 1e27a29 Fix collectd service subscription to conf file. 15f1ea7 Add Solaris collectd parameters c013e73 Add collectd df plugin support 9cac9c4 Add collectd support.
Dependencies
- puppetlabs/stdlib (>=3.0.0)
Puppet Collectd Module Copyright (C) 2013 Computer Action Team The Computer Action Team can be contacted at: support@cat.pdx.edu Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.