https://github.com/devops-works/ansible-telegraf
InfluxDB's Telegraf role (Ubuntu)
https://github.com/devops-works/ansible-telegraf
ansible-role influxdb telegraf
Last synced: about 1 year ago
JSON representation
InfluxDB's Telegraf role (Ubuntu)
- Host: GitHub
- URL: https://github.com/devops-works/ansible-telegraf
- Owner: devops-works
- Created: 2016-02-08T12:12:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T16:33:15.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T13:21:56.186Z (almost 2 years ago)
- Topics: ansible-role, influxdb, telegraf
- Language: Jinja
- Homepage:
- Size: 80.1 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ansible-telegraf role
======================
Installs [telegraf](https://github.com/influxdata/telegraf) on ubuntu
14.04 and up.
Requires Ansible 2.5+.
See
[defaults/main.yml](https://github.com/leucos/ansible-telegraf/blob/master/defaults/main.yml)
for supported variables.
## Variables
- `telegraf_enabled`: whether to install telegraf or not
- `telegraf_autoping`: whether to enable ping module and ping all inventory
hosts from each host
- `telegraf_install_latest`: if set to `true`, will always attempt to
install latest version
- `telegraf_agent_debug`: debug mode
- `telegraf_agent_hostname` hostname to use when reporting (default: inventory_hostname)
- `telegraf_agent_interval`: collecting interval
- `telegraf_agent_flush_interval`: reporting interval
- `telegraf_agent_flush_jitter`: jitter the flush interval by a random amount. This is primarily to avoid large write spikes for users running a large number of telegraf instances. ie, a jitter of 5s and flush_interval 10s means flushes will happen every 10-15s.
- `telegraf_agent_round_interval`: rounds collection interval to 'interval' ie, if interval="10s" then always collect on :00, :10, :20, etc.
- `telegraf_tags`: additional tags to add (dict)
- `telegraf_output_influxdb`: influxdb servers
## Inputs
Telegraf inputs are specified this way:
```
telegraf_inputs:
cpu:
percpu: "true"
totalcpu: "true"
drop: ["cpu_time"]
disk: {}
mem: {}
swap: {}
system: {}
```
You can use `_input_name` variable if you key is not reflecting an input
name. This is handy when you need several inputs with the same name (e.g. several CloudWatch inputs for different namespaces for instance). For instance:
```
telegraf_inputs:
cloudwatch_efs:
_input_name: cloudwatch
namespace: "AWS/EFS"
cloudwatch_rds:
_input_name: cloudwatch
namespace: "AWS/RDS"
cloudwatch_elb:
_input_name: cloudwatch
namespace: "AWS/ELB"
cpu:
percpu: "true"
totalcpu: "true"
drop: ["cpu_time"]
disk: {}
...
```
## MySQL
For mysql plugintg to work best, the following grants are required:
```sql
GRANT SELECT, PROCESS, REPLICATION CLIENT ON *.* TO 'monitoring'@'localhost'
```
`SELECT` is required if you need to gather data from `INFORMATION_SCHEMA`
tables.
## Testing
Run `vagrant up && vagrant ssh -c specs` to run specs (and play with telegraf).
Michel Blanc