Merge branch 'master' into master
This commit is contained in:
commit
4d0fa595e9
|
@ -19,6 +19,7 @@
|
||||||
- [#1697](https://github.com/influxdata/telegraf/pull/1697): Add NATS output plugin.
|
- [#1697](https://github.com/influxdata/telegraf/pull/1697): Add NATS output plugin.
|
||||||
- [#1407](https://github.com/influxdata/telegraf/pull/1407): HTTP service listener input plugin.
|
- [#1407](https://github.com/influxdata/telegraf/pull/1407): HTTP service listener input plugin.
|
||||||
- [#1699](https://github.com/influxdata/telegraf/pull/1699): Add database blacklist option for Postgresql
|
- [#1699](https://github.com/influxdata/telegraf/pull/1699): Add database blacklist option for Postgresql
|
||||||
|
- [#1791](https://github.com/influxdata/telegraf/pull/1791): Add Docker container state metrics to Docker input plugin output
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
|
|
@ -357,6 +357,30 @@
|
||||||
# data_format = "influx"
|
# data_format = "influx"
|
||||||
|
|
||||||
|
|
||||||
|
# # Send telegraf measurements to NATS
|
||||||
|
# [[outputs.nats]]
|
||||||
|
# ## URLs of NATS servers
|
||||||
|
# servers = ["nats://localhost:4222"]
|
||||||
|
# ## Optional credentials
|
||||||
|
# # username = ""
|
||||||
|
# # password = ""
|
||||||
|
# ## NATS subject for producer messages
|
||||||
|
# subject = "telegraf"
|
||||||
|
#
|
||||||
|
# ## Optional SSL Config
|
||||||
|
# # ssl_ca = "/etc/telegraf/ca.pem"
|
||||||
|
# # ssl_cert = "/etc/telegraf/cert.pem"
|
||||||
|
# # ssl_key = "/etc/telegraf/key.pem"
|
||||||
|
# ## Use SSL but skip chain & host verification
|
||||||
|
# # insecure_skip_verify = false
|
||||||
|
#
|
||||||
|
# ## Data format to output.
|
||||||
|
# ## Each data format has it's own unique set of configuration options, read
|
||||||
|
# ## more about them here:
|
||||||
|
# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
|
||||||
|
# data_format = "influx"
|
||||||
|
|
||||||
|
|
||||||
# # Send telegraf measurements to NSQD
|
# # Send telegraf measurements to NSQD
|
||||||
# [[outputs.nsq]]
|
# [[outputs.nsq]]
|
||||||
# ## Location of nsqd instance listening on TCP
|
# ## Location of nsqd instance listening on TCP
|
||||||
|
@ -376,13 +400,18 @@
|
||||||
# ## prefix for metrics keys
|
# ## prefix for metrics keys
|
||||||
# prefix = "my.specific.prefix."
|
# prefix = "my.specific.prefix."
|
||||||
#
|
#
|
||||||
# ## Telnet Mode ##
|
# ## DNS name of the OpenTSDB server
|
||||||
# ## DNS name of the OpenTSDB server in telnet mode
|
# ## Using "opentsdb.example.com" or "tcp://opentsdb.example.com" will use the
|
||||||
|
# ## telnet API. "http://opentsdb.example.com" will use the Http API.
|
||||||
# host = "opentsdb.example.com"
|
# host = "opentsdb.example.com"
|
||||||
#
|
#
|
||||||
# ## Port of the OpenTSDB server in telnet mode
|
# ## Port of the OpenTSDB server
|
||||||
# port = 4242
|
# port = 4242
|
||||||
#
|
#
|
||||||
|
# ## Number of data points to send to OpenTSDB in Http requests.
|
||||||
|
# ## Not used with telnet API.
|
||||||
|
# httpBatchSize = 50
|
||||||
|
#
|
||||||
# ## Debug true - Prints OpenTSDB communication
|
# ## Debug true - Prints OpenTSDB communication
|
||||||
# debug = false
|
# debug = false
|
||||||
|
|
||||||
|
@ -414,8 +443,8 @@
|
||||||
percpu = true
|
percpu = true
|
||||||
## Whether to report total system cpu stats or not
|
## Whether to report total system cpu stats or not
|
||||||
totalcpu = true
|
totalcpu = true
|
||||||
## Comment this line if you want the raw CPU time metrics
|
## If true, collect raw CPU time metrics.
|
||||||
fielddrop = ["time_*"]
|
collect_cpu_time = false
|
||||||
|
|
||||||
|
|
||||||
# Read metrics about disk usage by mount point
|
# Read metrics about disk usage by mount point
|
||||||
|
@ -530,14 +559,7 @@
|
||||||
# ## suffix used to identify socket files
|
# ## suffix used to identify socket files
|
||||||
# socket_suffix = "asok"
|
# socket_suffix = "asok"
|
||||||
#
|
#
|
||||||
# ## Ceph user to authenticate as, ceph will search for the corresponding keyring
|
# ## Ceph user to authenticate as
|
||||||
# ## e.g. client.admin.keyring in /etc/ceph, or the explicit path defined in the
|
|
||||||
# ## client section of ceph.conf for example:
|
|
||||||
# ##
|
|
||||||
# ## [client.telegraf]
|
|
||||||
# ## keyring = /etc/ceph/client.telegraf.keyring
|
|
||||||
# ##
|
|
||||||
# ## Consult the ceph documentation for more detail on keyring generation.
|
|
||||||
# ceph_user = "client.admin"
|
# ceph_user = "client.admin"
|
||||||
#
|
#
|
||||||
# ## Ceph configuration to use to locate the cluster
|
# ## Ceph configuration to use to locate the cluster
|
||||||
|
@ -546,8 +568,7 @@
|
||||||
# ## Whether to gather statistics via the admin socket
|
# ## Whether to gather statistics via the admin socket
|
||||||
# gather_admin_socket_stats = true
|
# gather_admin_socket_stats = true
|
||||||
#
|
#
|
||||||
# ## Whether to gather statistics via ceph commands, requires ceph_user and ceph_config
|
# ## Whether to gather statistics via ceph commands
|
||||||
# ## to be specified
|
|
||||||
# gather_cluster_stats = true
|
# gather_cluster_stats = true
|
||||||
|
|
||||||
|
|
||||||
|
@ -601,6 +622,11 @@
|
||||||
# ## Metric Statistic Namespace (required)
|
# ## Metric Statistic Namespace (required)
|
||||||
# namespace = 'AWS/ELB'
|
# namespace = 'AWS/ELB'
|
||||||
#
|
#
|
||||||
|
# ## Maximum requests per second. Note that the global default AWS rate limit is
|
||||||
|
# ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
|
||||||
|
# ## maximum of 10. Optional - default value is 10.
|
||||||
|
# ratelimit = 10
|
||||||
|
#
|
||||||
# ## Metrics to Pull (optional)
|
# ## Metrics to Pull (optional)
|
||||||
# ## Defaults to all Metrics in Namespace if nothing is provided
|
# ## Defaults to all Metrics in Namespace if nothing is provided
|
||||||
# ## Refreshes Namespace available metrics every 1h
|
# ## Refreshes Namespace available metrics every 1h
|
||||||
|
@ -718,6 +744,9 @@
|
||||||
# ## specify a list of one or more Elasticsearch servers
|
# ## specify a list of one or more Elasticsearch servers
|
||||||
# servers = ["http://localhost:9200"]
|
# servers = ["http://localhost:9200"]
|
||||||
#
|
#
|
||||||
|
# ## Timeout for HTTP requests to the elastic search server(s)
|
||||||
|
# http_timeout = "5s"
|
||||||
|
#
|
||||||
# ## set local to false when you want to read the indices stats from all nodes
|
# ## set local to false when you want to read the indices stats from all nodes
|
||||||
# ## within the cluster
|
# ## within the cluster
|
||||||
# local = true
|
# local = true
|
||||||
|
@ -860,6 +889,8 @@
|
||||||
# "http://localhost:9999/stats/",
|
# "http://localhost:9999/stats/",
|
||||||
# "http://localhost:9998/stats/",
|
# "http://localhost:9998/stats/",
|
||||||
# ]
|
# ]
|
||||||
|
# ## Set response_timeout (default 5 seconds)
|
||||||
|
# response_timeout = "5s"
|
||||||
#
|
#
|
||||||
# ## HTTP method to use: GET or POST (case-sensitive)
|
# ## HTTP method to use: GET or POST (case-sensitive)
|
||||||
# method = "GET"
|
# method = "GET"
|
||||||
|
@ -899,6 +930,9 @@
|
||||||
# urls = [
|
# urls = [
|
||||||
# "http://localhost:8086/debug/vars"
|
# "http://localhost:8086/debug/vars"
|
||||||
# ]
|
# ]
|
||||||
|
#
|
||||||
|
# ## http request & header timeout
|
||||||
|
# timeout = "5s"
|
||||||
|
|
||||||
|
|
||||||
# # Read metrics from one or many bare metal servers
|
# # Read metrics from one or many bare metal servers
|
||||||
|
@ -910,22 +944,11 @@
|
||||||
# ##
|
# ##
|
||||||
# servers = ["USERID:PASSW0RD@lan(192.168.1.1)"]
|
# servers = ["USERID:PASSW0RD@lan(192.168.1.1)"]
|
||||||
|
|
||||||
# # Gather packets and bytes throughput from iptables
|
|
||||||
# [[inputs.iptables]]
|
|
||||||
# ## iptables require root access on most systems.
|
|
||||||
# ## Setting 'use_sudo' to true will make use of sudo to run iptables.
|
|
||||||
# ## Users must configure sudo to allow telegraf user to run iptables.
|
|
||||||
# ## iptables can be restricted to only use list command "iptables -nvL"
|
|
||||||
# use_sudo = false
|
|
||||||
# ## define the table to monitor:
|
|
||||||
# table = "filter"
|
|
||||||
# ## Defines the chains to monitor:
|
|
||||||
# chains = [ "INPUT" ]
|
|
||||||
|
|
||||||
|
|
||||||
# # Read JMX metrics through Jolokia
|
# # Read JMX metrics through Jolokia
|
||||||
# [[inputs.jolokia]]
|
# [[inputs.jolokia]]
|
||||||
# ## This is the context root used to compose the jolokia url
|
# ## This is the context root used to compose the jolokia url
|
||||||
|
# ## NOTE that your jolokia security policy must allow for POST requests.
|
||||||
# context = "/jolokia"
|
# context = "/jolokia"
|
||||||
#
|
#
|
||||||
# ## This specifies the mode used
|
# ## This specifies the mode used
|
||||||
|
@ -1186,23 +1209,6 @@
|
||||||
# command = "passenger-status -v --show=xml"
|
# command = "passenger-status -v --show=xml"
|
||||||
|
|
||||||
|
|
||||||
# # Read metrics from one or many pgbouncer servers
|
|
||||||
# [[inputs.pgbouncer]]
|
|
||||||
# ## specify address via a url matching:
|
|
||||||
# ## postgres://[pqgotest[:password]]@localhost:port[/dbname]\
|
|
||||||
# ## ?sslmode=[disable|verify-ca|verify-full]
|
|
||||||
# ## or a simple string:
|
|
||||||
# ## host=localhost user=pqotest port=6432 password=... sslmode=... dbname=pgbouncer
|
|
||||||
# ##
|
|
||||||
# ## All connection parameters are optional, except for dbname,
|
|
||||||
# ## you need to set it always as pgbouncer.
|
|
||||||
# address = "host=localhost user=postgres port=6432 sslmode=disable dbname=pgbouncer"
|
|
||||||
#
|
|
||||||
# ## A list of databases to pull metrics about. If not specified, metrics for all
|
|
||||||
# ## databases are gathered.
|
|
||||||
# # databases = ["app_production", "testing"]
|
|
||||||
|
|
||||||
|
|
||||||
# # Read metrics of phpfpm, via HTTP status page or socket
|
# # Read metrics of phpfpm, via HTTP status page or socket
|
||||||
# [[inputs.phpfpm]]
|
# [[inputs.phpfpm]]
|
||||||
# ## An array of addresses to gather stats about. Specify an ip or hostname
|
# ## An array of addresses to gather stats about. Specify an ip or hostname
|
||||||
|
@ -1261,8 +1267,12 @@
|
||||||
# ##
|
# ##
|
||||||
# address = "host=localhost user=postgres sslmode=disable"
|
# address = "host=localhost user=postgres sslmode=disable"
|
||||||
#
|
#
|
||||||
|
# ## A list of databases to explicitly ignore. If not specified, metrics for all
|
||||||
|
# ## databases are gathered. Do NOT use with the 'databases' option.
|
||||||
|
# # ignored_databases = ["postgres", "template0", "template1"]
|
||||||
|
#
|
||||||
# ## A list of databases to pull metrics about. If not specified, metrics for all
|
# ## A list of databases to pull metrics about. If not specified, metrics for all
|
||||||
# ## databases are gathered.
|
# ## databases are gathered. Do NOT use with the 'ignore_databases' option.
|
||||||
# # databases = ["app_production", "testing"]
|
# # databases = ["app_production", "testing"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1429,6 +1439,61 @@
|
||||||
# servers = ["http://localhost:8098"]
|
# servers = ["http://localhost:8098"]
|
||||||
|
|
||||||
|
|
||||||
|
# # Retrieves SNMP values from remote agents
|
||||||
|
# [[inputs.snmp]]
|
||||||
|
# agents = [ "127.0.0.1:161" ]
|
||||||
|
# timeout = "5s"
|
||||||
|
# version = 2
|
||||||
|
#
|
||||||
|
# # SNMPv1 & SNMPv2 parameters
|
||||||
|
# community = "public"
|
||||||
|
#
|
||||||
|
# # SNMPv2 & SNMPv3 parameters
|
||||||
|
# max_repetitions = 50
|
||||||
|
#
|
||||||
|
# # SNMPv3 parameters
|
||||||
|
# #sec_name = "myuser"
|
||||||
|
# #auth_protocol = "md5" # Values: "MD5", "SHA", ""
|
||||||
|
# #auth_password = "password123"
|
||||||
|
# #sec_level = "authNoPriv" # Values: "noAuthNoPriv", "authNoPriv", "authPriv"
|
||||||
|
# #context_name = ""
|
||||||
|
# #priv_protocol = "" # Values: "DES", "AES", ""
|
||||||
|
# #priv_password = ""
|
||||||
|
#
|
||||||
|
# # measurement name
|
||||||
|
# name = "system"
|
||||||
|
# [[inputs.snmp.field]]
|
||||||
|
# name = "hostname"
|
||||||
|
# oid = ".1.0.0.1.1"
|
||||||
|
# [[inputs.snmp.field]]
|
||||||
|
# name = "uptime"
|
||||||
|
# oid = ".1.0.0.1.2"
|
||||||
|
# [[inputs.snmp.field]]
|
||||||
|
# name = "load"
|
||||||
|
# oid = ".1.0.0.1.3"
|
||||||
|
# [[inputs.snmp.field]]
|
||||||
|
# oid = "HOST-RESOURCES-MIB::hrMemorySize"
|
||||||
|
#
|
||||||
|
# [[inputs.snmp.table]]
|
||||||
|
# # measurement name
|
||||||
|
# name = "remote_servers"
|
||||||
|
# inherit_tags = [ "hostname" ]
|
||||||
|
# [[inputs.snmp.table.field]]
|
||||||
|
# name = "server"
|
||||||
|
# oid = ".1.0.0.0.1.0"
|
||||||
|
# is_tag = true
|
||||||
|
# [[inputs.snmp.table.field]]
|
||||||
|
# name = "connections"
|
||||||
|
# oid = ".1.0.0.0.1.1"
|
||||||
|
# [[inputs.snmp.table.field]]
|
||||||
|
# name = "latency"
|
||||||
|
# oid = ".1.0.0.0.1.2"
|
||||||
|
#
|
||||||
|
# [[inputs.snmp.table]]
|
||||||
|
# # auto populate table's fields using the MIB
|
||||||
|
# oid = "HOST-RESOURCES-MIB::hrNetworkTable"
|
||||||
|
|
||||||
|
|
||||||
# # DEPRECATED! PLEASE USE inputs.snmp INSTEAD.
|
# # DEPRECATED! PLEASE USE inputs.snmp INSTEAD.
|
||||||
# [[inputs.snmp_legacy]]
|
# [[inputs.snmp_legacy]]
|
||||||
# ## Use 'oids.txt' file to translate oids to names
|
# ## Use 'oids.txt' file to translate oids to names
|
||||||
|
@ -1601,6 +1666,16 @@
|
||||||
# SERVICE INPUT PLUGINS #
|
# SERVICE INPUT PLUGINS #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
# # Influx HTTP write listener
|
||||||
|
# [[inputs.http_listener]]
|
||||||
|
# ## Address and port to host HTTP listener on
|
||||||
|
# service_address = ":8186"
|
||||||
|
#
|
||||||
|
# ## timeouts
|
||||||
|
# read_timeout = "10s"
|
||||||
|
# write_timeout = "10s"
|
||||||
|
|
||||||
|
|
||||||
# # Read metrics from Kafka topic(s)
|
# # Read metrics from Kafka topic(s)
|
||||||
# [[inputs.kafka_consumer]]
|
# [[inputs.kafka_consumer]]
|
||||||
# ## topic(s) to consume
|
# ## topic(s) to consume
|
||||||
|
@ -1823,6 +1898,9 @@
|
||||||
# ## Address and port to host Webhook listener on
|
# ## Address and port to host Webhook listener on
|
||||||
# service_address = ":1619"
|
# service_address = ":1619"
|
||||||
#
|
#
|
||||||
|
# [inputs.webhooks.filestack]
|
||||||
|
# path = "/filestack"
|
||||||
|
#
|
||||||
# [inputs.webhooks.github]
|
# [inputs.webhooks.github]
|
||||||
# path = "/github"
|
# path = "/github"
|
||||||
#
|
#
|
||||||
|
|
|
@ -103,6 +103,9 @@ based on the availability of per-cpu stats on your system.
|
||||||
- n_used_file_descriptors
|
- n_used_file_descriptors
|
||||||
- n_cpus
|
- n_cpus
|
||||||
- n_containers
|
- n_containers
|
||||||
|
- n_containers_running
|
||||||
|
- n_containers_stopped
|
||||||
|
- n_containers_paused
|
||||||
- n_images
|
- n_images
|
||||||
- n_goroutines
|
- n_goroutines
|
||||||
- n_listener_events
|
- n_listener_events
|
||||||
|
@ -153,6 +156,9 @@ based on the availability of per-cpu stats on your system.
|
||||||
> docker n_cpus=8i 1456926671065383978
|
> docker n_cpus=8i 1456926671065383978
|
||||||
> docker n_used_file_descriptors=15i 1456926671065383978
|
> docker n_used_file_descriptors=15i 1456926671065383978
|
||||||
> docker n_containers=7i 1456926671065383978
|
> docker n_containers=7i 1456926671065383978
|
||||||
|
> docker n_containers_running=7i 1456926671065383978
|
||||||
|
> docker n_containers_stopped=3i 1456926671065383978
|
||||||
|
> docker n_containers_paused=0i 1456926671065383978
|
||||||
> docker n_images=152i 1456926671065383978
|
> docker n_images=152i 1456926671065383978
|
||||||
> docker n_goroutines=36i 1456926671065383978
|
> docker n_goroutines=36i 1456926671065383978
|
||||||
> docker n_listener_events=0i 1456926671065383978
|
> docker n_listener_events=0i 1456926671065383978
|
||||||
|
|
|
@ -154,6 +154,9 @@ func (d *Docker) gatherInfo(acc telegraf.Accumulator) error {
|
||||||
"n_cpus": info.NCPU,
|
"n_cpus": info.NCPU,
|
||||||
"n_used_file_descriptors": info.NFd,
|
"n_used_file_descriptors": info.NFd,
|
||||||
"n_containers": info.Containers,
|
"n_containers": info.Containers,
|
||||||
|
"n_containers_running": info.ContainersRunning,
|
||||||
|
"n_containers_stopped": info.ContainersStopped,
|
||||||
|
"n_containers_paused": info.ContainersPaused,
|
||||||
"n_images": info.Images,
|
"n_images": info.Images,
|
||||||
"n_goroutines": info.NGoroutines,
|
"n_goroutines": info.NGoroutines,
|
||||||
"n_listener_events": info.NEventsListener,
|
"n_listener_events": info.NEventsListener,
|
||||||
|
|
|
@ -256,6 +256,9 @@ type FakeDockerClient struct {
|
||||||
func (d FakeDockerClient) Info(ctx context.Context) (types.Info, error) {
|
func (d FakeDockerClient) Info(ctx context.Context) (types.Info, error) {
|
||||||
env := types.Info{
|
env := types.Info{
|
||||||
Containers: 108,
|
Containers: 108,
|
||||||
|
ContainersRunning: 98,
|
||||||
|
ContainersStopped: 6,
|
||||||
|
ContainersPaused: 3,
|
||||||
OomKillDisable: false,
|
OomKillDisable: false,
|
||||||
SystemTime: "2016-02-24T00:55:09.15073105-05:00",
|
SystemTime: "2016-02-24T00:55:09.15073105-05:00",
|
||||||
NEventsListener: 0,
|
NEventsListener: 0,
|
||||||
|
@ -397,6 +400,9 @@ func TestDockerGatherInfo(t *testing.T) {
|
||||||
"n_cpus": int(4),
|
"n_cpus": int(4),
|
||||||
"n_used_file_descriptors": int(19),
|
"n_used_file_descriptors": int(19),
|
||||||
"n_containers": int(108),
|
"n_containers": int(108),
|
||||||
|
"n_containers_running": int(98),
|
||||||
|
"n_containers_stopped": int(6),
|
||||||
|
"n_containers_paused": int(3),
|
||||||
"n_images": int(199),
|
"n_images": int(199),
|
||||||
"n_goroutines": int(39),
|
"n_goroutines": int(39),
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
@ -201,6 +202,9 @@ func (s *Sysstat) collect() error {
|
||||||
cmd := execCommand(s.Sadc, options...)
|
cmd := execCommand(s.Sadc, options...)
|
||||||
out, err := internal.CombinedOutputTimeout(cmd, time.Second*time.Duration(collectInterval+parseInterval))
|
out, err := internal.CombinedOutputTimeout(cmd, time.Second*time.Duration(collectInterval+parseInterval))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err := os.Remove(s.tmpFile); err != nil {
|
||||||
|
log.Printf("failed to remove tmp file after %s command: %s", strings.Join(cmd.Args, " "), err)
|
||||||
|
}
|
||||||
return fmt.Errorf("failed to run command %s: %s - %s", strings.Join(cmd.Args, " "), err, string(out))
|
return fmt.Errorf("failed to run command %s: %s - %s", strings.Join(cmd.Args, " "), err, string(out))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue