From 5d6622eb44eea2717d013388d4ddb7f1300a6d83 Mon Sep 17 00:00:00 2001 From: timhallinflux Date: Thu, 14 Dec 2017 14:58:37 -0800 Subject: [PATCH 01/17] Update README.md added `network` for a tiny bit more context --- plugins/inputs/bond/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/bond/README.md b/plugins/inputs/bond/README.md index 0a581418f589f..706a9c1c7622e 100644 --- a/plugins/inputs/bond/README.md +++ b/plugins/inputs/bond/README.md @@ -1,6 +1,6 @@ # Bond Input Plugin -The Bond Input plugin collects bond interface status, bond's slaves interfaces +The Bond Input plugin collects network bond interface status, bond's slaves interfaces status and failures count of bond's slaves interfaces. The plugin collects these metrics from `/proc/net/bonding/*` files. From ce4ca43a5d43fe1e6cd735080c0cacbc0dbb9e65 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:10:00 -0800 Subject: [PATCH 02/17] Fix name error in jolokia2_agent sample config (#3624) (cherry picked from commit 6c075c4346c795d4bec3505ec031fcc4d2766c46) --- etc/telegraf.conf | 2 +- plugins/inputs/jolokia2/jolokia_agent.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/telegraf.conf b/etc/telegraf.conf index 4c751d3e40de9..5972a84e82732 100644 --- a/etc/telegraf.conf +++ b/etc/telegraf.conf @@ -1661,7 +1661,7 @@ # # insecure_skip_verify = false # # ## Add metrics to read -# [[inputs.jolokia2.metric]] +# [[inputs.jolokia2_agent.metric]] # name = "java_runtime" # mbean = "java.lang:type=Runtime" # paths = ["Uptime"] diff --git a/plugins/inputs/jolokia2/jolokia_agent.go b/plugins/inputs/jolokia2/jolokia_agent.go index ff37fdaf656e5..1042da9d93f10 100644 --- a/plugins/inputs/jolokia2/jolokia_agent.go +++ b/plugins/inputs/jolokia2/jolokia_agent.go @@ -46,7 +46,7 @@ func (ja *JolokiaAgent) SampleConfig() string { # insecure_skip_verify = false ## Add metrics to read - [[inputs.jolokia2.metric]] + [[inputs.jolokia2_agent.metric]] name = "java_runtime" mbean = "java.lang:type=Runtime" paths = ["Uptime"] From 6852231c1b0df61efd41e1103bef29c1fd64ec2c Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:12:56 -0800 Subject: [PATCH 03/17] Update changelog (cherry picked from commit 1011cd0c947e5f5584ceab560e87cf3185e072f0) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e57a73bdad74..a444f22c9f3a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.5.1 [unreleased] + +### Bugfixes + +- [#3624](https://github.com/influxdata/telegraf/pull/3624): Fix name error in jolokia2_agent sample config. + ## v1.5 [2017-12-14] ### New Plugins From 55f35f291d30e3e7f5a5cd52f5386131dc97eeeb Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:17:40 -0800 Subject: [PATCH 04/17] Fix DC/OS login expiration time (#3625) (cherry picked from commit 005face7c0e263692d8d9a70b312be6acb307688) --- plugins/inputs/dcos/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/dcos/client.go b/plugins/inputs/dcos/client.go index 71165e9fbffd7..50d78482faa26 100644 --- a/plugins/inputs/dcos/client.go +++ b/plugins/inputs/dcos/client.go @@ -325,7 +325,7 @@ func (c *ClusterClient) createLoginToken(sa *ServiceAccount) (string, error) { UID: sa.AccountID, StandardClaims: jwt.StandardClaims{ // How long we have to login with this token - ExpiresAt: int64(5 * time.Minute / time.Second), + ExpiresAt: time.Now().Add(5 * time.Minute).Unix(), }, }) return token.SignedString(sa.PrivateKey) From 223bbf0df7988ce7323ca6dfb617b1b405bf50ff Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:19:04 -0800 Subject: [PATCH 05/17] Update changelog (cherry picked from commit ef6e5c5a85c8d218d784f6bf1d64ff118f5d0111) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a444f22c9f3a4..82167b77931a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Bugfixes - [#3624](https://github.com/influxdata/telegraf/pull/3624): Fix name error in jolokia2_agent sample config. +- [#3625](https://github.com/influxdata/telegraf/pull/3625): Fix DC/OS login expiration time. ## v1.5 [2017-12-14] From 83faea7a3117893b409296f1a407794c612a7557 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:22:19 -0800 Subject: [PATCH 06/17] Set content-type charset in influxdb output and allow it be overridden (#3593) (cherry picked from commit 4f7afb8cb5abb89f3f67c8e677bfa9fc057874d6) --- plugins/outputs/influxdb/client/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/outputs/influxdb/client/http.go b/plugins/outputs/influxdb/client/http.go index 4dea82a8d984a..601e40386c3f3 100644 --- a/plugins/outputs/influxdb/client/http.go +++ b/plugins/outputs/influxdb/client/http.go @@ -211,11 +211,12 @@ func (c *httpClient) makeRequest(uri string, body io.Reader) (*http.Request, err return nil, err } + req.Header.Set("Content-Type", "text/plain; charset=utf-8") + for header, value := range c.config.HTTPHeaders { req.Header.Set(header, value) } - req.Header.Set("Content-Type", "text/plain") req.Header.Set("User-Agent", c.config.UserAgent) if c.config.Username != "" && c.config.Password != "" { req.SetBasicAuth(c.config.Username, c.config.Password) From f8597f78f4e4382526e9fd36748d4eb2fab21cb1 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 28 Dec 2017 16:24:04 -0800 Subject: [PATCH 07/17] Update changelog (cherry picked from commit 06c21fb9f746336af4c8882226461fa1979f1d81) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82167b77931a9..c607e5e9a9195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [#3624](https://github.com/influxdata/telegraf/pull/3624): Fix name error in jolokia2_agent sample config. - [#3625](https://github.com/influxdata/telegraf/pull/3625): Fix DC/OS login expiration time. +- [#3593](https://github.com/influxdata/telegraf/pull/3593): Set Content-Type charset in influxdb output and allow it be overridden. ## v1.5 [2017-12-14] From 07985e6524b8c1ed86f25c885d4273a8c1f2fa5b Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Tue, 2 Jan 2018 14:09:14 -0800 Subject: [PATCH 08/17] Add information about how to set permissions for postfix input (#3594) (cherry picked from commit a440ed8d8c982a495d0bc89077289b38d920f810) --- plugins/inputs/postfix/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/inputs/postfix/README.md b/plugins/inputs/postfix/README.md index 477a78c9bf0d6..3dab2b39d2acb 100644 --- a/plugins/inputs/postfix/README.md +++ b/plugins/inputs/postfix/README.md @@ -13,6 +13,25 @@ For each of the active, hold, incoming, maildrop, and deferred queues (http://ww # queue_directory = "/var/spool/postfix" ``` +#### Permissions: + +Telegraf will need read access to the files in the queue directory. You may +need to alter the permissions of these directories to provide access to the +telegraf user. + +Unix permissions: +```sh +$ sudo chgrp -R telegraf /var/spool/postfix/{active,hold,incoming,deferred} +$ sudo chmod -R g+rXs /var/spool/postfix/{active,hold,incoming,deferred} +$ sudo usermod -a -G postdrop telegraf +$ sudo chmod g+r /var/spool/postfix/maildrop +``` + +Posix ACL: +```sh +$ sudo setfacl -Rdm u:telegraf:rX /var/spool/postfix/{active,hold,incoming,deferred,maildrop} +``` + ### Measurements & Fields: - postfix_queue From 384ef6af6bdf6cbd4c3c2f9a43409579a2e400f6 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Tue, 2 Jan 2018 16:36:04 -0800 Subject: [PATCH 09/17] Update changelog (cherry picked from commit 81f42e8b176656b5c2e3d46017e35c979fe26d6e) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c607e5e9a9195..a54d8be2f4942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#3624](https://github.com/influxdata/telegraf/pull/3624): Fix name error in jolokia2_agent sample config. - [#3625](https://github.com/influxdata/telegraf/pull/3625): Fix DC/OS login expiration time. - [#3593](https://github.com/influxdata/telegraf/pull/3593): Set Content-Type charset in influxdb output and allow it be overridden. +- [#3594](https://github.com/influxdata/telegraf/pull/3594): Document permissions setup for postfix input. ## v1.5 [2017-12-14] From 4aa8d72644634911a114c2d31c1e6084d54013f9 Mon Sep 17 00:00:00 2001 From: kerams Date: Wed, 3 Jan 2018 22:43:17 +0100 Subject: [PATCH 10/17] Fix deliver_get field in rabbitmq input (#3633) (cherry picked from commit acea7109d4307e351070eb24707b4a0a2f072210) --- plugins/inputs/rabbitmq/rabbitmq.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index f51cb123e5c82..7f60bf41e1398 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -72,7 +72,7 @@ type MessageStats struct { AckDetails Details `json:"ack_details"` Deliver int64 DeliverDetails Details `json:"deliver_details"` - DeliverGet int64 + DeliverGet int64 `json:"deliver_get"` DeliverGetDetails Details `json:"deliver_get_details"` Publish int64 PublishDetails Details `json:"publish_details"` From 865917f523e986eacf9d4f1e8fd60e4a89a2a67d Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 3 Jan 2018 13:44:33 -0800 Subject: [PATCH 11/17] Update changelog (cherry picked from commit 07cb749e044f997a41e9f1f9b3cc58e0368e6e2e) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a54d8be2f4942..78091d0e20e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#3625](https://github.com/influxdata/telegraf/pull/3625): Fix DC/OS login expiration time. - [#3593](https://github.com/influxdata/telegraf/pull/3593): Set Content-Type charset in influxdb output and allow it be overridden. - [#3594](https://github.com/influxdata/telegraf/pull/3594): Document permissions setup for postfix input. +- [#3633](https://github.com/influxdata/telegraf/pull/3633): Fix deliver_get field in rabbitmq input. ## v1.5 [2017-12-14] From fe6239cf9fc4fdd7293b621196b6a9fe95b84911 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 4 Jan 2018 15:28:00 -0800 Subject: [PATCH 12/17] Escape environment variables during config toml parsing (#3637) (cherry picked from commit b0c2bb870e51a24761e1b3b32943808a85200906) --- internal/config/config.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 98d68f9ef954a..2aaa2da192cf7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -40,6 +40,11 @@ var ( // envVarRe is a regex to find environment variables in the config file envVarRe = regexp.MustCompile(`\$\w+`) + + envVarEscaper = strings.NewReplacer( + `"`, `\"`, + `\`, `\\`, + ) ) // Config specifies the URL/user/password for the database that telegraf @@ -689,6 +694,11 @@ func trimBOM(f []byte) []byte { return bytes.TrimPrefix(f, []byte("\xef\xbb\xbf")) } +// escapeEnv escapes a value for inserting into a TOML string. +func escapeEnv(value string) string { + return envVarEscaper.Replace(value) +} + // parseFile loads a TOML configuration from a provided path and // returns the AST produced from the TOML parser. When loading the file, it // will find environment variables and replace them. @@ -702,8 +712,9 @@ func parseFile(fpath string) (*ast.Table, error) { env_vars := envVarRe.FindAll(contents, -1) for _, env_var := range env_vars { - env_val := os.Getenv(strings.TrimPrefix(string(env_var), "$")) - if env_val != "" { + env_val, ok := os.LookupEnv(strings.TrimPrefix(string(env_var), "$")) + if ok { + env_val = escapeEnv(env_val) contents = bytes.Replace(contents, env_var, []byte(env_val), 1) } } From cc478f035e1a316fdd7acf7001d9fb71175a0858 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 4 Jan 2018 15:29:56 -0800 Subject: [PATCH 13/17] Update changelog (cherry picked from commit 315fd1e987cbef245a2ab33df5561d54396ce748) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78091d0e20e60..0f37f36869074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#3593](https://github.com/influxdata/telegraf/pull/3593): Set Content-Type charset in influxdb output and allow it be overridden. - [#3594](https://github.com/influxdata/telegraf/pull/3594): Document permissions setup for postfix input. - [#3633](https://github.com/influxdata/telegraf/pull/3633): Fix deliver_get field in rabbitmq input. +- [#3607](https://github.com/influxdata/telegraf/issues/3607): Escape environment variables during config toml parsing. ## v1.5 [2017-12-14] From 45b7db7de1da8963f203b47bdeded29cdeafd098 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 4 Jan 2018 15:34:55 -0800 Subject: [PATCH 14/17] Add link to docs for configuring the openldap monitoring backend (cherry picked from commit 37757b7782390ca77354c1af9e7d98d3cb23afdd) --- plugins/inputs/openldap/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inputs/openldap/README.md b/plugins/inputs/openldap/README.md index a57aabb84b7c4..e55d1650914fa 100644 --- a/plugins/inputs/openldap/README.md +++ b/plugins/inputs/openldap/README.md @@ -4,6 +4,8 @@ This plugin gathers metrics from OpenLDAP's cn=Monitor backend. ### Configuration: +To use this plugin you must enable the [monitoring](https://www.openldap.org/devel/admin/monitoringslapd.html) backend. + ```toml [[inputs.openldap]] host = "localhost" From 4e89c17c0fb77567f5934f0c268d17bb34f5a863 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 10 Jan 2018 13:28:28 -0800 Subject: [PATCH 15/17] Set 1.5.1 release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f37f36869074..018ce39fa3fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v1.5.1 [unreleased] +## v1.5.1 [2017-01-10] ### Bugfixes From 0605af7c99c801b389bda2ad94603350a24e52ea Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Mon, 8 Jan 2018 18:48:17 -0800 Subject: [PATCH 16/17] Pin crate docker image for testing (cherry picked from commit 3cf0ba1ccf42dd8b4631a7dcb9bcabfcad374c33) --- Makefile | 8 +------- plugins/outputs/cratedb/cratedb_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index d8ccf2faf4746..a0c340eebc1f9 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ docker-run: -d cobaugh/openldap-alpine docker run --name cratedb \ -p "6543:5432" \ - -d crate crate \ + -d crate:2.2 \ -Cnetwork.host=0.0.0.0 \ -Ctransport.host=localhost \ -Clicense.enterprise=false @@ -116,12 +116,6 @@ docker-run-circle: -e SLAPD_CONFIG_ROOTPW="secret" \ -p "389:389" -p "636:636" \ -d cobaugh/openldap-alpine - docker run --name cratedb \ - -p "6543:5432" \ - -d crate crate \ - -Cnetwork.host=0.0.0.0 \ - -Ctransport.host=localhost \ - -Clicense.enterprise=false docker-kill: -docker kill aerospike elasticsearch kafka memcached mqtt mysql nats nsq \ diff --git a/plugins/outputs/cratedb/cratedb_test.go b/plugins/outputs/cratedb/cratedb_test.go index 46fdd7b84f23a..be1d889c0c17c 100644 --- a/plugins/outputs/cratedb/cratedb_test.go +++ b/plugins/outputs/cratedb/cratedb_test.go @@ -19,6 +19,10 @@ func TestConnectAndWrite(t *testing.T) { t.Skip("Skipping integration test in short mode") } + if os.Getenv("CIRCLE_PROJECT_REPONAME") != "" { + t.Skip("Skipping test on CircleCI due to docker failures") + } + url := testURL() table := "test" @@ -95,6 +99,10 @@ func Test_escapeValue(t *testing.T) { t.Skip("Skipping integration test in short mode") } + if os.Getenv("CIRCLE_PROJECT_REPONAME") != "" { + t.Skip("Skipping test on CircleCI due to docker failures") + } + tests := []struct { Val interface{} Want string From 7a8e7fe30efb63ec18555a099025b84156e998c9 Mon Sep 17 00:00:00 2001 From: Charlie Smith Date: Thu, 11 Jan 2018 17:14:07 -0500 Subject: [PATCH 17/17] update changelog for SignalFx 1.5.1 release --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b3f7868d3a3d..6fe23aaeaf993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ -## v1.5.0.sfx0 [2018-01-08] +## v1.5.1.sfx0 [2018-01-12] ### Release Notes -- Rebase with upstream v1.5.0 release +- Rebase with upstream v1.5.1 release - Fixed bug in SignalFx Utilization plugin where disk.summary_utilization was reported with out a hostname - Distribute SignalFx metadata and process info collection across multiple go routines +- Batch metric output to SignalFx + ## v1.5.1 [2017-01-10] ### Bugfixes