From fc49bfad23b1b2efb23d9488b39083f1e3522f07 Mon Sep 17 00:00:00 2001 From: Joshua Buysse Date: Wed, 21 Nov 2012 12:59:11 -0600 Subject: [PATCH 1/5] Parameterized df, interface, and syslog plugins and added a recipe for the load plugin. --- recipes/df.rb | 7 ++++--- recipes/interface.rb | 3 ++- recipes/load.rb | 22 ++++++++++++++++++++++ recipes/syslog.rb | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 recipes/load.rb diff --git a/recipes/df.rb b/recipes/df.rb index b3716d0..fa5ae2b 100644 --- a/recipes/df.rb +++ b/recipes/df.rb @@ -20,7 +20,8 @@ include_recipe "collectd" collectd_plugin "df" do - options(:report_reserved=>false, - "FSType"=>["proc", "sysfs", "fusectl", "debugfs", "securityfs", "devtmpfs", "devpts", "tmpfs"], - :ignore_selected=>true) + options(:report_reserved => node['collectd_plugins']['df']['report_reserved'], + :report_inodes => node['collectd_plugins']['df']['report_inodes'], + "FSType" => [node['collectd_plugins']['df']['selected_fstypes']].flatten, + :ignore_selected => node['collectd_plugins']['df']['ignore_selected']) end diff --git a/recipes/interface.rb b/recipes/interface.rb index 6d6ec8e..f703bfc 100644 --- a/recipes/interface.rb +++ b/recipes/interface.rb @@ -20,5 +20,6 @@ include_recipe "collectd" collectd_plugin "interface" do - options :interface=>"lo", :ignore_selected=>true + options :interface => [node['collectd_plugins']['interface']['selected_interfaces']].flatten, + :ignore_selected => node['collectd_plugins']['interface']['ignore_selected'] end diff --git a/recipes/load.rb b/recipes/load.rb new file mode 100644 index 0000000..bdeeea3 --- /dev/null +++ b/recipes/load.rb @@ -0,0 +1,22 @@ +# +# Cookbook Name:: collectd_plugins +# Recipe:: swap +# +# +# +# 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. +# + +include_recipe "collectd" + +collectd_plugin "load" diff --git a/recipes/syslog.rb b/recipes/syslog.rb index cbed9fe..5150858 100644 --- a/recipes/syslog.rb +++ b/recipes/syslog.rb @@ -20,5 +20,5 @@ include_recipe "collectd" collectd_plugin "syslog" do - options :log_level=>"Info" + options :log_level => node['collectd_plugins']['syslog']['log_level'] end From 9fed509f0a1f48b8dded0cc4b585e4a97cdb2b44 Mon Sep 17 00:00:00 2001 From: Joshua Buysse Date: Wed, 21 Nov 2012 13:00:17 -0600 Subject: [PATCH 2/5] Missed attributes directory in previous commit; completion of parameterized plugins. --- attributes/default.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 attributes/default.rb diff --git a/attributes/default.rb b/attributes/default.rb new file mode 100644 index 0000000..b61b5a2 --- /dev/null +++ b/attributes/default.rb @@ -0,0 +1,15 @@ +# list of filesystem types to monitor (or ignore) for the df plugin +# if ignore_selected is true, it's a blacklist; if ignore_selected is false, it's a whitelist +default['collectd_plugins']['df']['selected_fstypes'] = ["proc", "sysfs", "fusectl", "debugfs", "securityfs", "devtmpfs", "devpts", "tmpfs"] +default['collectd_plugins']['df']['ignore_selected'] = true +# report reserved space and inode counts +default['collectd_plugins']['df']['report_reserved'] = false +default['collectd_plugins']['df']['report_inodes'] = false + +# allowable: emerg, alert, crit, err, warning, notice, info, debug +default['collectd_plugins']['syslog']['log_level'] = "info" + +# list of network interfaces to monitor (or ignore) for the interface plugin +# if ignore_selected is true, it's a blacklist; if ignore_selected is false, it's a whitelist +default['collectd_plugins']['interface']['selected_interfaces'] = ["lo"] +default['collectd_plugins']['interface']['ignore_selected'] = true From 610a812ea861baf975ab24fb40f30f1f1b6d9fee Mon Sep 17 00:00:00 2001 From: Joshua Buysse Date: Wed, 12 Dec 2012 17:32:47 -0600 Subject: [PATCH 3/5] Documented attributes from pull request coderanger/chef-collectd_plugins#2 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index b700f79..514c1cf 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,23 @@ A number of recipes for standard plugins are available: It is recommended to always enable the first two (rrdtool and syslog), but the others are entirely optional. For convenience, the `collectd_plugins` default recipe will include all of these. +# ATTRIBUTES # + +Several of the plugins use host attributes to control behavior. + +* df plugin +** `node['collectd_plugins']['df']['selected_fstypes']` - array of filesystem types to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `["proc", "sysfs", "fusectl", "debugfs", "securityfs", "devtmpfs", "devpts", "tmpfs"]`. +** `node['collectd_plugins']['df']['ignore_selected']` - boolean value; if true, use the `'selected_fstypes'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. +** `node['collectd_plugins']['df']['report_reserved']` - boolean value; controls if we measure reserved space on the filesystem. Defaults to false. +** `node['collectd_plugins']['df']['report_inodes']` - boolean value; controls if we measure inode counts on the filesystem. Defaults to false. + +* syslog plugin +** `node['collectd_plugins']['syslog']['log_level']` - string; syslog priority used. Allowable values are: emerg, alert, crit, err, warning, notice, info, debug. Default is 'info'. + +* interface plugin +** `node['collectd_plugins']['interface']['selected_interfaces']` - array of network interfaces to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `[ "lo" ]`. +** `node['collectd_plugins']['interface']['ignore_selected']` - boolean value; if true, use the `'selected_interfaces'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. + ## Redis ## A plugin to monitor [Redis](http://redis.io/) is included as `collectd_plugins::redis`. This recipe requires that you be using our [redis cookbook](https://github.com/AtariTech/cookbooks/tree/master/redis) From 0e1c13e6eebd9e6f31e14f67c89ee021763d9017 Mon Sep 17 00:00:00 2001 From: Joshua Buysse Date: Wed, 12 Dec 2012 17:34:53 -0600 Subject: [PATCH 4/5] Fixed formatting on README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 514c1cf..086d3a1 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,18 @@ It is recommended to always enable the first two (rrdtool and syslog), but the o Several of the plugins use host attributes to control behavior. -* df plugin -** `node['collectd_plugins']['df']['selected_fstypes']` - array of filesystem types to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `["proc", "sysfs", "fusectl", "debugfs", "securityfs", "devtmpfs", "devpts", "tmpfs"]`. -** `node['collectd_plugins']['df']['ignore_selected']` - boolean value; if true, use the `'selected_fstypes'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. -** `node['collectd_plugins']['df']['report_reserved']` - boolean value; controls if we measure reserved space on the filesystem. Defaults to false. -** `node['collectd_plugins']['df']['report_inodes']` - boolean value; controls if we measure inode counts on the filesystem. Defaults to false. - -* syslog plugin -** `node['collectd_plugins']['syslog']['log_level']` - string; syslog priority used. Allowable values are: emerg, alert, crit, err, warning, notice, info, debug. Default is 'info'. - -* interface plugin -** `node['collectd_plugins']['interface']['selected_interfaces']` - array of network interfaces to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `[ "lo" ]`. -** `node['collectd_plugins']['interface']['ignore_selected']` - boolean value; if true, use the `'selected_interfaces'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. +## df plugin ## +* `node['collectd_plugins']['df']['selected_fstypes']` - array of filesystem types to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `["proc", "sysfs", "fusectl", "debugfs", "securityfs", "devtmpfs", "devpts", "tmpfs"]`. +* `node['collectd_plugins']['df']['ignore_selected']` - boolean value; if true, use the `'selected_fstypes'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. +* `node['collectd_plugins']['df']['report_reserved']` - boolean value; controls if we measure reserved space on the filesystem. Defaults to false. +* `node['collectd_plugins']['df']['report_inodes']` - boolean value; controls if we measure inode counts on the filesystem. Defaults to false. + +## syslog plugin ## +* `node['collectd_plugins']['syslog']['log_level']` - string; syslog priority used. Allowable values are: emerg, alert, crit, err, warning, notice, info, debug. Default is 'info'. + +## interface plugin ## +* `node['collectd_plugins']['interface']['selected_interfaces']` - array of network interfaces to monitor or ignore. If `'ignore_selected'` is true (default), this is a list of ignored types, and if it's false, it's a whitelist. The default value is `[ "lo" ]`. +* `node['collectd_plugins']['interface']['ignore_selected']` - boolean value; if true, use the `'selected_interfaces'` attribute as a blacklist; if false, treat `'selected_fstypes'` as a whitelist. The default is true. ## Redis ## From 58cf68b5440a99a59b26f06a58d3ebebba2cac53 Mon Sep 17 00:00:00 2001 From: Peter Walz Date: Mon, 23 Jan 2017 15:12:48 -0600 Subject: [PATCH 5/5] Add missing name attribute --- metadata.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/metadata.rb b/metadata.rb index 9da5889..605e400 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,3 +1,4 @@ +name "collectd_plugins" maintainer "Noan Kantrowitz" maintainer_email "noah@coderanger.net" license "Apache 2.0"