cookbook 'collectd-abiquo', '~> 0.2.0'
collectd-abiquo (3) Versions 0.2.0 Follow1
Installs and configures the Abiquo collectd plugin
cookbook 'collectd-abiquo', '~> 0.2.0', :supermarket
knife supermarket install collectd-abiquo
knife supermarket download collectd-abiquo
Chef cookbook for the abiquo-writer collectd plugin
This cookbook provides a recipe to install the Abiquo collectd plugin.
It integrates any virtual machine deployed in the Abiquo platform with the
metrics system and allows them to push their own metrics to the Abiquo API.
Requirements
The cookbook has been tested in the following platforms:
- CentOS 6.7
- Ubuntu 16.04
The cookbook depends on the following cookbooks:
- collectd-lib
- python
- yum-epel
Recipes
-
recipe[collectd-abiquo]
- Installs collectd and the Abiquo monitoring plugin -
recipe[collectd-abiquo::collectd]
- Installs and configures collectd and the default plugins -
recipe[collectd-abiquo::plugin]
- Installs and configures the Abiquo collectd plugin
Attributes
The following attributes are under the node['collectd_abiquo']
namespace.
Attribute | Description | Type | Mandatory | Default value |
---|---|---|---|---|
['endpoint'] |
The endpoint where the plugin will push the metrics | String | Yes | nil |
['auth_type'] |
The authentication method used to push metrics to the Abiquo API (basic | oauth) | String | No |
['python_module_path'] |
The path where python modules are installed | String | No | /usr/lib/collectd |
['packages'] |
The names of the collectd packages to install | List | No | ['collectd'] (['collectd-core', 'libpython2.7'] in Ubuntu) |
['plugins'] |
The names of the default collectd plugins to install | List | No | ['cpu', 'disk', 'interface'] |
['log_traces'] |
Enables the Abiquo plugin log | Boolean | No | true |
['version'] |
The version of the Abiquo plugin to install | String | No | master |
['url'] |
The URL of the Abiquo plugin file | String | Yes | https://rawgit.com/abiquo/collectd-abiquo/master/abiquo-writer.py |
['verify_ssl'] |
Enable SSL validation when pushing the metrics | Boolean | No | false |
['flush_interval_secs'] |
Interval in which the metrics are pushed, in seconds | Integer | No | 30 |
Usage
The cookbook is pretty straightforward to use. Just set all the mandatory attributes with the values for
the notification endpoint and the authentication type, and include the recipe[collectd-abiquo]
in the
run list. You'll have to configure a data bag with the credentials in the Chef Server as explained below.
Configuring access to the Abiquo API
In order to let the collectd plugin push metrics to the Abiquo API, the credentials must be stored in a
data bag with an item named collectd_basic
(for basic auth credentials) or collectd_oauth
(for OAuth
credentials). The recipes will pick the right data bag item according to the value of the node['collectd_abiquo']['auth_type']
attribute. The name of the data bag can be configured with the node['collectd_abiquo']['credentials_data_bag']
8defaults to abiquo_credentials
). Convenience items are included in this cookbook. You can upload them to the
Chef Server as follows:
knife data bag create abiquo_credentials
knife data bag from file abiquo_credentials data_bags/abiquo_credentials/collectd_basic.json
knife data bag from file abiquo_credentials data_bags/abiquo_credentials/collectd_oauth.json
Testing
In order to test the cookbook you will need to install Vagrant and VirtualBox.
Once installed you can run the unit and integration tests as follows:
bundle install
bundle exec berks install # Install the cookbook dependencies
bundle exec rake # Run the unit and style tests
bundle exec rake kitchen # Run the integration tests
The tests and Gemfile have been developed using Ruby 2.1.5, and that is the recommended Ruby version to use to run the tests.
Other versions may cause conflicts with the versions of the gems Bundler will install.
License and authors
- Author:: Enric Ruiz (enric.ruiz@abiquo.com)
- Author:: Ignasi Barrera (ignasi.barrera@abiquo.com)
Copyright:: 2015, Abiquo
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.
Dependent cookbooks
collectd-lib ~> 3.1.0 |
python ~> 1.4.6 |
yum-epel ~> 2.1.1 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
CHANGELOG
0.2.0
- Fix cookbook metadata to include the recipes.
- Credentials are stored in a data bag.
0.1.0
- Use OAuth to authenticate to the Abiquo API.
- Enable cpu, memory, disk and interface plugins by default.
- Initial release.
Collaborator Number Metric
0.2.0 passed this metric
Contributing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC066: Ensure chef_version is set in metadata: collectd-abiquo/metadata.rb:1
FC069: Ensure standardized license defined in metadata: collectd-abiquo/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 passed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC066: Ensure chef_version is set in metadata: collectd-abiquo/metadata.rb:1
FC069: Ensure standardized license defined in metadata: collectd-abiquo/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
FC069: Ensure standardized license defined in metadata: collectd-abiquo/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number