Ansible Role telegraf
This role installs and configures Telegraf.
Mandatory Requirements
Enable the official InfluxDB repository. This can be done using the linuxfabrik.lfops.repo_influxdb role.
Optional Role Variables
Variable |
Description |
Default Value |
---|---|---|
|
Default data collection interval for all inputs |
|
|
List of dictionaries. Configurations to deploy to
|
[] |
|
Read metrics about cpu usage |
|
|
Read metrics about disk usage by mount point |
|
|
Read metrics about disk IO by device |
|
|
Get kernel statistics from /proc/stat |
|
|
Read metrics about memory usage |
|
|
Gather metrics about network interfaces |
|
|
Get the number of processes and group them by status |
|
|
Read metrics about swap memory usage |
|
|
Read metrics about system load & uptime |
|
|
Read metrics from one or many vCenters |
|
|
|
|
|
|
|
|
List of vCenter URLs to be monitored. |
|
|
The target database for metrics; will be created as needed. For UDP url endpoint database needs to be configured on server side. |
|
|
HTTP Basic Auth |
|
|
We assume that the InfluxDB role creates the database. |
|
|
The full HTTP or UDP URL for your InfluxDB instance. Multiple URLs can be specified for a single cluster, only ONE of the urls will be written to each interval. |
|
|
HTTP Basic Auth |
|
|
Enables or disables the telegraf service, analogous to |
|
|
Changes the state of the service, analogous to |
|
Example:
# optional
telegraf__agent_interval: '10s'
telegraf__conf__host_var:
- filename: 'graylog'
state: 'present'
template: 'graylog'
username: 'linuxfabrik' # graylog access token (need to be sent as the username)
telegraf__inputs_cpu_enable: false
telegraf__inputs_disk_enable: false
telegraf__inputs_diskio_enable: false
telegraf__inputs_kernel_enable: false
telegraf__inputs_mem_enable: false
telegraf__inputs_net_enable: false
telegraf__inputs_processes_enable: false
telegraf__inputs_swap_enable: false
telegraf__inputs_system_enable: false
telegraf__inputs_vsphere_enable: true
telegraf__inputs_vsphere_password: 'password'
telegraf__inputs_vsphere_username: 'username'
telegraf__inputs_vsphere_vcenters:
- 'https://vsphere/sdk'
telegraf__outputs_influxdb_database: 'telegraf'
telegraf__outputs_influxdb_password: 'password'
telegraf__outputs_influxdb_skip_database_creation: true
telegraf__outputs_influxdb_urls:
- 'http://127.0.0.1:8086'
telegraf__outputs_influxdb_username: 'telegraf'
telegraf__service_enabled: true
telegraf__service_state: 'started'