Skip to content

Parameterized attributes for df, interface, and syslog plugin, and added a recipe for the load plugin. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name "collectd_plugins"
maintainer "Noan Kantrowitz"
maintainer_email "[email protected]"
license "Apache 2.0"
Expand Down
7 changes: 4 additions & 3 deletions recipes/df.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion recipes/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions recipes/load.rb
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion recipes/syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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