telegraf/README.md

260 lines
12 KiB
Markdown
Raw Normal View History

2016-01-07 22:21:10 +00:00
# Telegraf [![Circle CI](https://circleci.com/gh/influxdata/telegraf.svg?style=svg)](https://circleci.com/gh/influxdata/telegraf)
2015-05-20 05:26:13 +00:00
Telegraf is an agent written in Go for collecting metrics from the system it's
2016-01-07 22:21:10 +00: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-19 16:34:27 +00: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
from well known services (like Hadoop, Postgres, or Redis) and third party
APIs (like Mailchimp, AWS CloudWatch, or Google Analytics).
2015-06-19 16:34:27 +00:00
2016-01-07 22:21:10 +00: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-19 16:34:27 +00:00
## Installation:
2015-05-20 05:26:13 +00:00
### Linux deb and rpm Packages:
2015-08-20 21:18:45 +00:00
Latest:
2016-05-13 10:57:22 +00:00
* https://dl.influxdata.com/telegraf/releases/telegraf_0.13.0_amd64.deb
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0.x86_64.rpm
2016-01-07 22:21:10 +00:00
Latest (arm):
2016-05-13 10:57:22 +00:00
* https://dl.influxdata.com/telegraf/releases/telegraf_0.13.0_armhf.deb
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0.armhf.rpm
##### Package Instructions:
* Telegraf binary is installed in `/usr/bin/telegraf`
* Telegraf daemon configuration file is in `/etc/telegraf/telegraf.conf`
* 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`
### yum/apt Repositories:
There is a yum/apt repo available for the whole InfluxData stack, see
2016-03-21 20:30:59 +00:00
[here](https://docs.influxdata.com/influxdb/v0.10/introduction/installation/#installation)
for instructions on setting up the repo. Once it is configured, you will be able
to use this repo to install & update telegraf.
2016-01-27 18:59:05 +00:00
### Linux tarballs:
Latest:
2016-05-13 10:57:22 +00:00
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_linux_amd64.tar.gz
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_linux_i386.tar.gz
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_linux_armhf.tar.gz
2016-01-07 22:21:10 +00:00
##### tarball Instructions:
2016-01-27 18:59:05 +00:00
To install the full directory structure with config file, run:
```
2016-05-13 10:57:22 +00:00
sudo tar -C / -zxvf ./telegraf-0.13.0_linux_amd64.tar.gz
2016-01-27 18:59:05 +00:00
```
To extract only the binary, run:
```
2016-05-13 10:57:22 +00:00
tar -zxvf telegraf-0.13.0_linux_amd64.tar.gz --strip-components=3 ./usr/bin/telegraf
2016-01-27 18:59:05 +00:00
```
2015-06-19 16:34:27 +00:00
2016-03-17 15:53:55 +00:00
### FreeBSD tarball:
Latest:
2016-05-13 10:57:22 +00:00
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_freebsd_amd64.tar.gz
2016-03-17 15:53:55 +00:00
##### tarball Instructions:
2016-03-21 20:30:59 +00:00
See linux instructions above.
2016-03-17 15:53:55 +00:00
2016-01-30 18:53:17 +00:00
### Ansible Role:
Ansible role: https://github.com/rossmcdonald/telegraf
2015-06-20 01:53:35 +00:00
### OSX via Homebrew:
```
brew update
brew install telegraf
```
2016-02-23 22:59:02 +00:00
### Windows Binaries (EXPERIMENTAL)
Latest:
2016-05-13 10:57:22 +00:00
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_windows_amd64.zip
* https://dl.influxdata.com/telegraf/releases/telegraf-0.13.0_windows_i386.zip
2016-02-23 22:59:02 +00:00
### From Source:
2015-12-08 23:18:23 +00:00
Telegraf manages dependencies via [gdm](https://github.com/sparrc/gdm),
which gets installed via the Makefile
2016-01-19 16:37:17 +00:00
if you don't have it already. You also must build with golang version 1.5+.
1. [Install Go](https://golang.org/doc/install)
2. [Setup your GOPATH](https://golang.org/doc/code.html#GOPATH)
2016-01-20 18:57:35 +00:00
3. Run `go get github.com/influxdata/telegraf`
4. Run `cd $GOPATH/src/github.com/influxdata/telegraf`
5. Run `make`
2016-01-30 18:53:17 +00:00
## How to use it:
2015-06-20 01:53:35 +00:00
2016-01-07 22:21:10 +00:00
```console
$ telegraf -help
Telegraf, The plugin-driven server agent for collecting and reporting metrics.
2016-01-07 22:21:10 +00: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'
-debug print metrics as they're generated to stdout
-quiet run in quiet mode
2016-01-07 22:21:10 +00: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 05:26:13 +00:00
2015-12-11 20:07:32 +00:00
## Configuration
2016-02-18 20:37:36 +00:00
See the [configuration guide](docs/CONFIGURATION.md) for a rundown of the more advanced
2015-12-11 20:07:32 +00:00
configuration options.
2016-01-07 22:21:10 +00:00
## Supported Input Plugins
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:
2016-04-06 19:49:50 +00:00
* [aws cloudwatch](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cloudwatch)
2016-04-04 22:34:41 +00:00
* [aerospike](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/aerospike)
* [apache](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/apache)
* [bcache](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/bcache)
* [cassandra](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cassandra)
2016-04-04 22:34:41 +00:00
* [couchbase](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchbase)
* [couchdb](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchdb)
* [disque](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/disque)
* [dns query time](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dns_query)
* [docker](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker)
* [dovecot](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dovecot)
* [elasticsearch](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/elasticsearch)
2016-04-22 01:47:23 +00:00
* [exec](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec) (generic executable plugin, support JSON, influx, graphite and nagios)
* [filestat](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/filestat)
2016-04-04 22:34:41 +00:00
* [haproxy](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/haproxy)
* [http_response](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_response)
* [httpjson](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/httpjson) (generic JSON-emitting http service plugin)
2016-04-04 22:34:41 +00:00
* [influxdb](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb)
* [ipmi_sensor](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ipmi_sensor)
* [jolokia](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia)
* [leofs](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/leofs)
* [lustre2](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/lustre2)
* [mailchimp](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mailchimp)
* [memcached](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/memcached)
* [mesos](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mesos)
* [mongodb](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb)
* [mysql](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mysql)
* [net_response](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/net_response)
* [nginx](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nginx)
* [nsq](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nsq)
* [nstat](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nstat)
2016-04-04 22:34:41 +00:00
* [ntpq](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ntpq)
* [phpfpm](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/phpfpm)
* [phusion passenger](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/passenger)
* [ping](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping)
* [postgresql](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/postgresql)
* [postgresql_extensible](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/postgresql_extensible)
* [powerdns](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/powerdns)
* [procstat](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat)
* [prometheus](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus)
* [puppetagent](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/puppetagent)
* [rabbitmq](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rabbitmq)
* [raindrops](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/raindrops)
* [redis](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/redis)
* [rethinkdb](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rethinkdb)
* [riak](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/riak)
2016-04-04 21:57:52 +00:00
* [sensors ](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sensors) (only available if built from source)
2016-04-04 22:34:41 +00:00
* [snmp](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/snmp)
2016-04-04 21:57:52 +00:00
* [sql server](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sqlserver) (microsoft)
2016-04-04 22:34:41 +00:00
* [twemproxy](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/twemproxy)
* [zfs](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zfs)
* [zookeeper](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zookeeper)
2016-04-04 21:57:52 +00:00
* [win_perf_counters ](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters) (windows performance counters)
2016-04-07 17:05:20 +00:00
* [sysstat](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sysstat)
2016-04-04 22:34:41 +00:00
* [system](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system)
2015-09-04 23:05:50 +00:00
* cpu
* mem
* net
2015-10-14 23:53:47 +00:00
* netstat
2015-09-04 23:05:50 +00:00
* disk
2015-12-11 20:07:32 +00:00
* diskio
2015-09-04 23:05:50 +00:00
* swap
* processes
* kernel (/proc/stat)
Telegraf can also collect metrics via the following service plugins:
2016-04-04 21:57:52 +00:00
* [statsd](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd)
* [udp_listener](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener)
* [tcp_listener](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tcp_listener)
* [mqtt_consumer](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mqtt_consumer)
* [kafka_consumer](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/kafka_consumer)
* [nats_consumer](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nats_consumer)
* [github_webhooks](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/github_webhooks)
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-07 22:21:10 +00:00
## Supported Output Plugins
2015-06-19 16:38:31 +00:00
2016-04-04 21:57:52 +00:00
* [influxdb](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb)
* [amon](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/amon)
* [amqp](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/amqp)
* [aws kinesis](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/kinesis)
* [aws cloudwatch](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/cloudwatch)
* [datadog](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/datadog)
2016-04-12 20:50:56 +00:00
* [file](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/file)
2016-04-04 21:57:52 +00:00
* [graphite](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/graphite)
* [kafka](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/kafka)
* [librato](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/librato)
* [mqtt](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/mqtt)
* [nsq](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/nsq)
* [opentsdb](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/opentsdb)
* [prometheus](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/prometheus_client)
* [riemann](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/riemann)
2015-06-19 16:38:31 +00:00
## Contributing
2015-06-19 16:38:31 +00:00
Please see the
[contributing guide](CONTRIBUTING.md)
2016-01-30 18:53:17 +00:00
for details on contributing a plugin to Telegraf.