cookbook 'telegraf-ng', '~> 0.0.2'
telegraf-ng (2) Versions 0.0.2 Follow0
Installs/Configures telegraf
cookbook 'telegraf-ng', '~> 0.0.2', :supermarket
knife supermarket install telegraf-ng
knife supermarket download telegraf-ng
telegraf-ng Cookbook
This is a Chef cookbook to manage InfluxDB Telegraf.
For Production environment, always prefer the most recent release.
Most Recent Release
cookbook 'telegraf', '~> 0.0.2'
From Git
cookbook 'telegraf', github: 'vkhatri/chef-telegraf', tag: "v0.0.2"
Repository
https://github.com/vkhatri/chef-telegraf-ng
Supported OS
This cookbook was tested on Amazon & Ubuntu Linux and expected to work on other RHEL platforms.
Cookbook Dependency
None
TODO
- add ubuntu version pin support
Recipes
telegraf::default
- default recipe (use it for run_list)telegraf::install
- install telegraftelegraf::config
- configure telegraftelegraf::inputs
- configure telegraf inputs using node attributenode['telegraf']['inputs']
telegraf::outputs
- configure telegraf outputs using node attributenode['telegraf']['outputs']
telegraf::service
- configure telegraf servicetelegraf::example
- examples recipe to configure default inputs/outputs using HWRP
HWRP telegraf_input
HWRP telegraf_input
creates telegraf inputs configuration files under directory node['telegraf']['conf_d_dir']
with file name input-#{resource_name}.conf
.
HWRP example
telegraf_input 'cpu' do config fielddrop: ['time_*'] end
HWRP Options
- action (optional) - default :create, options: :create, :delete
- config (optional, Hash) - telegraf input options
- name (optional, String) - telegraf input name
HWRP telegraf_output
HWRP telegraf_output
creates telegraf outputs configuration files under directory node['telegraf']['conf_d_dir']
with file name output-#{resource_name}.conf
.
HWRP example
telegraf_output 'influxdb' do config urls: ['http://localhost:8086'], database: 'telegraf', precision: 's' end
HWRP Options
- action (optional) - default :create, options: :create, :delete
- config (optional, Hash) - telegraf output options
- name (optional, String) - telegraf output name
How to Add Telegraf Input via Node Attribute
{ "default_attributes": { "telegraf": { "inputs": { "cpu": { "fielddrop": ["time_*"] }, "disk": { "ignore_fs": ["tmpfs", "devtmpfs"] }, "diskio": {}, "kernel": {}, "mem": {}, "processes": {}, "net": { "interfaces": ["eth0"] }, "swap": {}, "system": {}, "ntpq": {}, "netstat": {}, "procstat": { "pattern": "/usr/bin/telegraf" } } } } }
How to Add Telegraf Output via Node Attribute
{ "default_attributes": { "telegraf": { "outputs": { "influxdb": { "urls": ["http://localhost:8086"], "database": "telegraf", "precision": "s" } } } } }
Core Attributes
default['telegraf']['version']
(default:1.0.0
): telegraf version, applicable only torhel
platformdefault['telegraf']['conf_dir']
(default:/etc/telegraf
): telegraf toml configuration file directorydefault['telegraf']['conf_d_dir']
(default:/etc/telegraf/telegraf.d
): telegraf inputs/outputs configuration files directorydefault['telegraf']['conf_file']
(default:/etc/telegraf/telegraf.conf
): telegraf configuration filedefault['telegraf']['notify_restart']
(default:true
): whether to restart telegraf service on configuration file changedefault['telegraf']['disable_service']
(default:false
): whether to stop and disable telegraf servicedefault['telegraf']['user']
(default:telegraf
): telegraf userdefault['telegraf']['group']
(default:telegraf
): telegraf group
Configuration File telegraf.conf Attributes
default['telegraf']['config']['tags']
(default:{}
): telegraf global tagsdefault['telegraf']['config']['agent']['interval']
(default:10s
): telegraf agent configuration parameterdefault['telegraf']['config']['agent']['round_interval']
(default:true
): telegraf agent configuration parameterdefault['telegraf']['config']['agent']['flush_interval']
(default:10s
): telegraf agent configuration parameterdefault['telegraf']['config']['agent']['flush_jitter']
(default:5s
): telegraf agent configuration parameter
telegraf YUM/APT Repository Attributes
default['telegraf']['yum']['description']
(default: ``): telegraf yum reporitory attributedefault['telegraf']['yum']['gpgcheck']
(default:true
): telegraf yum reporitory attributedefault['telegraf']['yum']['enabled']
(default:true
): telegraf yum reporitory attributedefault['telegraf']['yum']['baseurl']
(default:calculated
): telegraf yum reporitory attributedefault['telegraf']['yum']['gpgkey']
(default:https://repos.influxdata.com/influxdb.key
): telegraf yum reporitory attributedefault['telegraf']['yum']['action']
(default::create
): telegraf yum reporitory attributedefault['telegraf']['apt']['description']
(default: ``): telegraf apt reporitory attributedefault['telegraf']['apt']['components']
(default:['stable']
): telegraf apt reporitory attributedefault['telegraf']['apt']['uri']
(default:https//repos.influxdata.com/debian
): telegraf apt reporitory attributedefault['telegraf']['apt']['key']
(default:https//repos.influxdata.com/influxdb.key
): telegraf apt reporitory attributedefault['telegraf']['apt']['action']
(default::add
): telegraf apt reporitory attribute
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests (
rake & rake knife
), ensuring they all pass - Write new resource/attribute description to
README.md
- Write description about changes to PR
- Submit a Pull Request using Github
Copyright & License
Authors:: Virender Khatri and Contributors
<pre>
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.
</pre>
Dependent cookbooks
yum-plugin-versionlock >= 0.1.2 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
telegraf-ng CHANGELOG
This file is used to list changes made in each version of the telegraf cookbook.
0.0.2
Virender Khatri - fix toml require at compile time
Virender Khatri - added yum version pinning
Virender Khatri - added apt package options
Virender Khatri - set default version to 1.0.0
0.0.1
- Virender Khatri - Initial release of telegraf-ng
Check the Markdown Syntax Guide for help with Markdown.
The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.
Collaborator Number Metric
0.0.2 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.0.2 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.0.2 failed this metric
FC066: Ensure chef_version is set in metadata: telegraf-ng/metadata.rb:1
FC069: Ensure standardized license defined in metadata: telegraf-ng/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:24
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:24
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.0.2 passed this metric
Testing File Metric
0.0.2 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.0.2 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.0.2 failed this metric
0.0.2 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.0.2 failed this metric
FC066: Ensure chef_version is set in metadata: telegraf-ng/metadata.rb:1
FC069: Ensure standardized license defined in metadata: telegraf-ng/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:24
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:24
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.0.2 passed this metric
Testing File Metric
0.0.2 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.0.2 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.0.2 failed this metric
FC069: Ensure standardized license defined in metadata: telegraf-ng/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_input.rb:24
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:20
FC085: Resource using new_resource.updated_by_last_action to converge resource: telegraf-ng/libraries/provider_output.rb:24
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.0.2 passed this metric
Testing File Metric
0.0.2 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.0.2 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.0.2 failed this metric
0.0.2 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