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.
If you use the telegraf playbook, this is automatically done for you.
Optional Role Variables
Variable |
Description |
Default Value |
|---|---|---|
|
String. Default data collection interval for all inputs. |
|
|
List of dictionaries. Configurations to deploy to
|
|
|
Boolean. Read metrics about cpu usage. |
|
|
Boolean. Read metrics about disk usage by mount point. |
|
|
Boolean. Read metrics about disk IO by device. |
|
|
Boolean. Get kernel statistics from |
|
|
Boolean. Read metrics about memory usage. |
|
|
Boolean. Gather metrics about network interfaces. |
|
|
Boolean. Get the number of processes and group them by status. |
|
|
Boolean. Read metrics about swap memory usage. |
|
|
Boolean. Read metrics about system load & uptime. |
|
|
Boolean. Read metrics from one or many vCenters. |
|
|
String. Password for vSphere authentication. |
|
|
String. Username for vSphere authentication. |
|
|
List of strings. vCenter URLs to be monitored. |
|
|
String. The target database for metrics; will be created as needed. For UDP url endpoint database needs to be configured on server side. |
|
|
String. Password for HTTP Basic Auth to InfluxDB. |
|
|
Boolean. Skip database creation (we assume the InfluxDB role creates the database). |
|
|
List of strings. 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. |
|
|
String. Username for HTTP Basic Auth to InfluxDB. |
|
|
Boolean. Enables or disables the telegraf service, analogous to |
|
|
String. Changes the state of the service, analogous to |
|
Example:
# optional
telegraf__agent_interval: '30s'
telegraf__conf__host_var:
- filename: 'graylog'
state: 'present'
template: 'graylog'
username: 'linuxfabrik' # graylog access token (needs to be sent as the username)
- filename: 'custom-input'
state: 'present'
template: 'raw'
raw: |
[[inputs.exec]]
commands = ["/usr/local/bin/my-custom-script.sh"]
data_format = "influx"
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'