cookbook 'telegraf-ng', '= 0.0.1'
telegraf-ng (2) Versions 0.0.1 Follow0
Installs/Configures telegraf
cookbook 'telegraf-ng', '= 0.0.1', :supermarket
knife supermarket install telegraf-ng
knife supermarket download telegraf-ng
telegraf-ng Cookbook
This is a Chef cookbook to manage InfluxDB.
For Production environment, always prefer the most recent release.
Most Recent Release
cookbook 'telegraf', '~> 0.0.1'
From Git
cookbook 'telegraf', github: 'vkhatri/chef-telegraf', tag: "v0.0.1"
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
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:nil
): telegraf version, default install latestdefault['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
This cookbook has no specified dependencies.
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.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.
Foodcritic Metric
0.0.1 passed this metric
0.0.1 passed this metric