2016-01-08 06:21:10 +08:00
|
|
|
# Telegraf [](https://circleci.com/gh/influxdata/telegraf)
|
2015-05-20 13:26:13 +08:00
|
|
|
|
2015-08-07 04:00:14 +08:00
|
|
|
Telegraf is an agent written in Go for collecting metrics from the system it's
|
2016-01-08 06:21:10 +08:00
|
|
|
running on, or from other services, and writing them into InfluxDB or other
|
|
|
|
|
[outputs](https://github.com/influxdata/telegraf#supported-output-plugins).
|
2015-06-20 00:34:27 +08:00
|
|
|
|
2015-08-07 04:00:14 +08:00
|
|
|
Design goals are to have a minimal memory footprint with a plugin system so
|
|
|
|
|
that developers in the community can easily add support for collecting metrics
|
2015-09-10 01:00:19 +08:00
|
|
|
from well known services (like Hadoop, Postgres, or Redis) and third party
|
2015-08-07 04:00:14 +08:00
|
|
|
APIs (like Mailchimp, AWS CloudWatch, or Google Analytics).
|
2015-06-20 00:34:27 +08:00
|
|
|
|
2016-01-08 06:21:10 +08:00
|
|
|
New input and output plugins are designed to be easy to contribute,
|
|
|
|
|
we'll eagerly accept pull
|
|
|
|
|
requests and will manage the set of plugins that Telegraf supports.
|
|
|
|
|
See the [contributing guide](CONTRIBUTING.md) for instructions on writing
|
|
|
|
|
new plugins.
|
2015-06-20 00:34:27 +08:00
|
|
|
|
2015-09-10 01:00:19 +08:00
|
|
|
## Installation:
|
2015-05-20 13:26:13 +08:00
|
|
|
|
2016-01-15 01:20:01 +08:00
|
|
|
NOTE: Telegraf 0.10.x is **not** backwards-compatible with previous versions
|
|
|
|
|
of telegraf, both in the database layout and the configuration file. 0.2.x
|
|
|
|
|
will continue to be supported, see below for download links.
|
2016-01-08 06:21:10 +08:00
|
|
|
|
2016-01-15 01:20:01 +08:00
|
|
|
For more details on the differences between Telegraf 0.2.x and 0.10.x, see
|
|
|
|
|
the [release blog post](https://influxdata.com/blog/announcing-telegraf-0-10-0/).
|
2016-01-08 06:21:10 +08:00
|
|
|
|
2016-01-31 02:30:01 +08:00
|
|
|
### Linux deb and rpm Packages:
|
2015-09-10 01:00:19 +08:00
|
|
|
|
2015-08-21 05:18:45 +08:00
|
|
|
Latest:
|
2016-02-25 01:05:10 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf_0.10.4.1-1_amd64.deb
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1.x86_64.rpm
|
2016-01-08 06:21:10 +08:00
|
|
|
|
2016-02-23 07:59:45 +08:00
|
|
|
Latest (arm):
|
2016-02-25 01:05:10 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf_0.10.4.1-1_arm.deb
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1.arm.rpm
|
2016-02-23 07:59:45 +08:00
|
|
|
|
2016-01-08 06:21:10 +08:00
|
|
|
0.2.x:
|
2015-12-08 03:22:52 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf_0.2.4_amd64.deb
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.2.4-1.x86_64.rpm
|
2015-09-10 01:00:19 +08:00
|
|
|
|
2016-01-31 02:30:01 +08:00
|
|
|
##### Package Instructions:
|
2015-09-10 01:00:19 +08:00
|
|
|
|
2016-01-09 06:07:44 +08:00
|
|
|
* Telegraf binary is installed in `/usr/bin/telegraf`
|
|
|
|
|
* Telegraf daemon configuration file is in `/etc/telegraf/telegraf.conf`
|
2015-09-10 01:00:19 +08:00
|
|
|
* On sysv systems, the telegraf daemon can be controlled via
|
|
|
|
|
`service telegraf [action]`
|
|
|
|
|
* On systemd systems (such as Ubuntu 15+), the telegraf daemon can be
|
|
|
|
|
controlled via `systemctl [action] telegraf`
|
|
|
|
|
|
2016-01-31 02:30:01 +08:00
|
|
|
### yum/apt Repositories:
|
|
|
|
|
|
|
|
|
|
There is a yum/apt repo available for the whole InfluxData stack, see
|
|
|
|
|
[here](https://docs.influxdata.com/influxdb/v0.9/introduction/installation/#installation)
|
|
|
|
|
for instructions, replacing the `influxdb` package name with `telegraf`.
|
|
|
|
|
|
2016-01-28 02:59:05 +08:00
|
|
|
### Linux tarballs:
|
2015-09-10 01:00:19 +08:00
|
|
|
|
|
|
|
|
Latest:
|
2016-02-25 01:05:10 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1_linux_amd64.tar.gz
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1_linux_i386.tar.gz
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1_linux_arm.tar.gz
|
2016-01-08 06:21:10 +08:00
|
|
|
|
|
|
|
|
0.2.x:
|
2015-12-08 03:22:52 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf_linux_amd64_0.2.4.tar.gz
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf_linux_386_0.2.4.tar.gz
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf_linux_arm_0.2.4.tar.gz
|
2015-09-05 04:12:50 +08:00
|
|
|
|
2016-01-31 02:30:01 +08:00
|
|
|
##### tarball Instructions:
|
2015-09-10 01:00:19 +08:00
|
|
|
|
2016-01-28 02:59:05 +08:00
|
|
|
To install the full directory structure with config file, run:
|
|
|
|
|
|
|
|
|
|
```
|
2016-02-25 01:05:10 +08:00
|
|
|
sudo tar -C / -zxvf ./telegraf-0.10.4.1-1_linux_amd64.tar.gz
|
2016-01-28 02:59:05 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To extract only the binary, run:
|
|
|
|
|
|
|
|
|
|
```
|
2016-02-25 01:05:10 +08:00
|
|
|
tar -zxvf telegraf-0.10.4.1-1_linux_amd64.tar.gz --strip-components=3 ./usr/bin/telegraf
|
2016-01-28 02:59:05 +08:00
|
|
|
```
|
2015-06-20 00:34:27 +08:00
|
|
|
|
2016-01-31 02:53:17 +08:00
|
|
|
### Ansible Role:
|
|
|
|
|
|
|
|
|
|
Ansible role: https://github.com/rossmcdonald/telegraf
|
|
|
|
|
|
2015-06-20 09:53:35 +08:00
|
|
|
### OSX via Homebrew:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
brew update
|
|
|
|
|
brew install telegraf
|
|
|
|
|
```
|
|
|
|
|
|
2016-02-24 06:59:02 +08:00
|
|
|
### Windows Binaries (EXPERIMENTAL)
|
|
|
|
|
|
|
|
|
|
Latest:
|
2016-02-25 01:05:10 +08:00
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1_windows_amd64.zip
|
|
|
|
|
* http://get.influxdb.org/telegraf/telegraf-0.10.4.1-1_windows_i386.zip
|
2016-02-24 06:59:02 +08:00
|
|
|
|
2015-08-19 00:16:59 +08:00
|
|
|
### From Source:
|
|
|
|
|
|
2015-12-09 07:18:23 +08:00
|
|
|
Telegraf manages dependencies via [gdm](https://github.com/sparrc/gdm),
|
|
|
|
|
which gets installed via the Makefile
|
2016-01-20 00:37:17 +08:00
|
|
|
if you don't have it already. You also must build with golang version 1.5+.
|
2015-08-26 08:16:01 +08:00
|
|
|
|
|
|
|
|
1. [Install Go](https://golang.org/doc/install)
|
|
|
|
|
2. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH)
|
2016-01-21 02:57:35 +08:00
|
|
|
3. Run `go get github.com/influxdata/telegraf`
|
|
|
|
|
4. Run `cd $GOPATH/src/github.com/influxdata/telegraf`
|
2015-10-20 05:26:08 +08:00
|
|
|
5. Run `make`
|
2015-08-19 00:16:59 +08:00
|
|
|
|
2016-01-31 02:53:17 +08:00
|
|
|
## How to use it:
|
2015-06-20 09:53:35 +08:00
|
|
|
|
2016-01-08 06:21:10 +08:00
|
|
|
```console
|
|
|
|
|
$ telegraf -help
|
2016-01-16 03:25:56 +08:00
|
|
|
Telegraf, The plugin-driven server agent for collecting and reporting metrics.
|
2016-01-08 06:21:10 +08:00
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
|
|
telegraf <flags>
|
|
|
|
|
|
|
|
|
|
The flags are:
|
|
|
|
|
|
|
|
|
|
-config <file> configuration file to load
|
|
|
|
|
-test gather metrics once, print them to stdout, and exit
|
|
|
|
|
-sample-config print out full sample configuration to stdout
|
|
|
|
|
-config-directory directory containing additional *.conf files
|
|
|
|
|
-input-filter filter the input plugins to enable, separator is :
|
|
|
|
|
-output-filter filter the output plugins to enable, separator is :
|
|
|
|
|
-usage print usage for a plugin, ie, 'telegraf -usage mysql'
|
2016-01-16 03:25:56 +08:00
|
|
|
-debug print metrics as they're generated to stdout
|
|
|
|
|
-quiet run in quiet mode
|
2016-01-08 06:21:10 +08:00
|
|
|
-version print the version to stdout
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
|
|
# generate a telegraf config file:
|
|
|
|
|
telegraf -sample-config > telegraf.conf
|
|
|
|
|
|
|
|
|
|
# generate config with only cpu input & influxdb output plugins defined
|
|
|
|
|
telegraf -sample-config -input-filter cpu -output-filter influxdb
|
|
|
|
|
|
|
|
|
|
# run a single telegraf collection, outputing metrics to stdout
|
|
|
|
|
telegraf -config telegraf.conf -test
|
|
|
|
|
|
|
|
|
|
# run telegraf with all plugins defined in config file
|
|
|
|
|
telegraf -config telegraf.conf
|
|
|
|
|
|
|
|
|
|
# run telegraf, enabling the cpu & memory input, and influxdb output plugins
|
|
|
|
|
telegraf -config telegraf.conf -input-filter cpu:mem -output-filter influxdb
|
|
|
|
|
```
|
2015-05-20 13:26:13 +08:00
|
|
|
|
2015-12-12 04:07:32 +08:00
|
|
|
## Configuration
|
2015-12-01 22:15:28 +08:00
|
|
|
|
2016-02-19 04:37:36 +08:00
|
|
|
See the [configuration guide](docs/CONFIGURATION.md) for a rundown of the more advanced
|
2015-12-12 04:07:32 +08:00
|
|
|
configuration options.
|
2015-11-25 05:22:11 +08:00
|
|
|
|
2016-01-08 06:21:10 +08:00
|
|
|
## Supported Input Plugins
|
2015-08-14 03:44:41 +08:00
|
|
|
|
2016-01-15 03:34:22 +08:00
|
|
|
Telegraf currently has support for collecting metrics from many sources. For
|
|
|
|
|
more information on each, please look at the directory of the same name in
|
|
|
|
|
`plugins/inputs`.
|
|
|
|
|
|
|
|
|
|
Currently implemented sources:
|
2015-08-14 03:44:41 +08:00
|
|
|
|
2015-10-22 08:08:43 +08:00
|
|
|
* aerospike
|
2015-09-05 07:05:50 +08:00
|
|
|
* apache
|
2015-10-20 01:38:16 +08:00
|
|
|
* bcache
|
2016-02-05 19:54:08 +08:00
|
|
|
* couchdb
|
2015-08-21 04:40:23 +08:00
|
|
|
* disque
|
2016-02-22 01:43:24 +08:00
|
|
|
* dns query time
|
2016-01-21 07:21:19 +08:00
|
|
|
* docker
|
2016-02-06 00:58:21 +08:00
|
|
|
* dovecot
|
2015-08-21 04:40:23 +08:00
|
|
|
* elasticsearch
|
2016-02-01 11:43:38 +08:00
|
|
|
* exec (generic executable plugin, support JSON, influx and graphite)
|
2015-08-21 04:40:23 +08:00
|
|
|
* haproxy
|
|
|
|
|
* httpjson (generic JSON-emitting http service plugin)
|
2015-12-19 07:21:39 +08:00
|
|
|
* influxdb
|
2015-12-12 04:07:32 +08:00
|
|
|
* jolokia
|
2015-08-21 04:40:23 +08:00
|
|
|
* leofs
|
|
|
|
|
* lustre2
|
2015-12-02 05:05:24 +08:00
|
|
|
* mailchimp
|
2015-08-21 04:40:23 +08:00
|
|
|
* memcached
|
2016-02-11 08:37:24 +08:00
|
|
|
* mesos
|
2015-08-21 04:40:23 +08:00
|
|
|
* mongodb
|
|
|
|
|
* mysql
|
2016-01-27 08:12:54 +08:00
|
|
|
* net_response
|
2015-08-21 04:40:23 +08:00
|
|
|
* nginx
|
2016-01-17 08:29:02 +08:00
|
|
|
* nsq
|
2015-10-16 20:13:09 +08:00
|
|
|
* phpfpm
|
2016-01-15 09:09:38 +08:00
|
|
|
* phusion passenger
|
2015-09-05 07:05:50 +08:00
|
|
|
* ping
|
2015-08-21 04:40:23 +08:00
|
|
|
* postgresql
|
2016-01-29 22:53:50 +08:00
|
|
|
* powerdns
|
2015-10-08 02:31:49 +08:00
|
|
|
* procstat
|
2015-08-21 04:40:23 +08:00
|
|
|
* prometheus
|
2015-10-17 01:48:33 +08:00
|
|
|
* puppetagent
|
2015-08-21 04:40:23 +08:00
|
|
|
* rabbitmq
|
2016-02-14 18:27:13 +08:00
|
|
|
* raindrops
|
2015-08-21 04:40:23 +08:00
|
|
|
* redis
|
|
|
|
|
* rethinkdb
|
2016-02-20 04:30:40 +08:00
|
|
|
* riak
|
2016-02-22 07:35:56 +08:00
|
|
|
* sensors (only available if built from source)
|
|
|
|
|
* snmp
|
2016-01-27 03:30:02 +08:00
|
|
|
* sql server (microsoft)
|
2015-11-13 00:25:42 +08:00
|
|
|
* twemproxy
|
2015-11-09 20:37:00 +08:00
|
|
|
* zfs
|
2015-10-15 07:53:47 +08:00
|
|
|
* zookeeper
|
2016-01-23 06:02:21 +08:00
|
|
|
* win_perf_counters (windows performance counters)
|
2015-09-05 07:05:50 +08:00
|
|
|
* system
|
|
|
|
|
* cpu
|
|
|
|
|
* mem
|
|
|
|
|
* net
|
2015-10-15 07:53:47 +08:00
|
|
|
* netstat
|
2015-09-05 07:05:50 +08:00
|
|
|
* disk
|
2015-12-12 04:07:32 +08:00
|
|
|
* diskio
|
2015-09-05 07:05:50 +08:00
|
|
|
* swap
|
2016-03-08 18:42:31 +08:00
|
|
|
* processes
|
2015-08-14 03:44:41 +08:00
|
|
|
|
2016-01-09 06:07:44 +08:00
|
|
|
Telegraf can also collect metrics via the following service plugins:
|
2015-10-08 06:11:52 +08:00
|
|
|
|
|
|
|
|
* statsd
|
2016-03-08 18:42:31 +08:00
|
|
|
* udp_listener
|
|
|
|
|
* tcp_listener
|
2016-02-10 06:03:46 +08:00
|
|
|
* mqtt_consumer
|
2015-11-17 04:12:45 +08:00
|
|
|
* kafka_consumer
|
2016-02-12 18:05:33 +08:00
|
|
|
* nats_consumer
|
2016-01-27 06:57:06 +08:00
|
|
|
* github_webhooks
|
2015-10-08 06:11:52 +08:00
|
|
|
|
2015-08-14 03:44:41 +08:00
|
|
|
We'll be adding support for many more over the coming months. Read on if you
|
|
|
|
|
want to add support for another service or third-party API.
|
|
|
|
|
|
2016-01-08 06:21:10 +08:00
|
|
|
## Supported Output Plugins
|
2015-06-20 00:38:31 +08:00
|
|
|
|
2015-08-29 00:18:46 +08:00
|
|
|
* influxdb
|
2016-01-09 06:07:44 +08:00
|
|
|
* amon
|
|
|
|
|
* amqp
|
2016-01-19 03:39:14 +08:00
|
|
|
* aws kinesis
|
|
|
|
|
* aws cloudwatch
|
2015-08-29 00:18:46 +08:00
|
|
|
* datadog
|
2016-01-17 08:29:02 +08:00
|
|
|
* graphite
|
2016-01-09 06:07:44 +08:00
|
|
|
* kafka
|
2015-10-27 02:31:21 +08:00
|
|
|
* librato
|
2016-01-09 06:07:44 +08:00
|
|
|
* mqtt
|
|
|
|
|
* nsq
|
|
|
|
|
* opentsdb
|
2015-10-29 06:19:13 +08:00
|
|
|
* prometheus
|
2015-10-23 05:50:19 +08:00
|
|
|
* riemann
|
2015-06-20 00:38:31 +08:00
|
|
|
|
2015-08-29 00:18:46 +08:00
|
|
|
## Contributing
|
2015-06-20 00:38:31 +08:00
|
|
|
|
2015-08-29 00:18:46 +08:00
|
|
|
Please see the
|
2015-09-10 01:00:19 +08:00
|
|
|
[contributing guide](CONTRIBUTING.md)
|
2016-01-31 02:53:17 +08:00
|
|
|
for details on contributing a plugin to Telegraf.
|