jamescarr.telegraf
Ansible 角色:Telegraf
在 Debian/Ubuntu 上安装 Telegraf。
需求
无
角色变量
可用变量如下所示,以及默认值(见 defaults/main.yml
):
依赖关系
无。
示例剧本
以下是使用 influxdb 统计信息作为输入,influxdb 作为输出的示例剧本。
- hosts: utility
vars_files:
- vars/main.yml
roles:
- jamescarr.telegraf
telegraf_render_config: true
plugins:
outputs:
influxdb:
urls:
- 'http://localhost:8086'
database: telegraf
precision: s
retention_policy: default
write_consistency: any
timeout: 5s
inputs:
influxdb:
urls: ['http://localhost:8086/debug/vars']
此角色还包括一个模块,您可以使用它添加独立的输入/输出配置,这些配置将渲染到 /etc/telegraf/conf.d
下。
- name: 添加文件输入
telegraf_config:
name: mcrouter
plugins:
input:
tail:
name_prefix: mcrouter_log
from_beginning: true
data_format: value
data_type: string
files:
- /var/log/mcrouter/mcrouter.log
如果需要,您还可以为配置文件指定一个模板。
- name: 添加文件输入
telegraf_config:
name: mcrouter
template: mcrouter.conf.j2
TODO:使用各种输入的更多示例。
许可证
MIT / BSD
作者信息
该角色由 James Carr 于 2016 年创建。
关于项目
An ansible role to install and configure Telegraf (https://influxdata.com/time-series-platform/telegraf/)
安装
ansible-galaxy install jamescarr.telegraf
许可证
Unknown
下载
17.5k
拥有者
Engineering Leader, Meditator and Bourbon Enthusiast.
Currently on the Pro Leisure Circuit.