Compare commits

...

32 Commits

Author SHA1 Message Date
Daniel Nelson
0605af7c99 Pin crate docker image for testing
(cherry picked from commit 3cf0ba1ccf)
2018-01-10 14:11:36 -08:00
Daniel Nelson
4e89c17c0f Set 1.5.1 release date 2018-01-10 13:28:28 -08:00
Daniel Nelson
45b7db7de1 Add link to docs for configuring the openldap monitoring backend
(cherry picked from commit 37757b7782)
2018-01-04 15:35:45 -08:00
Daniel Nelson
cc478f035e Update changelog
(cherry picked from commit 315fd1e987)
2018-01-04 15:30:23 -08:00
Daniel Nelson
fe6239cf9f Escape environment variables during config toml parsing (#3637)
(cherry picked from commit b0c2bb870e)
2018-01-04 15:30:17 -08:00
Daniel Nelson
865917f523 Update changelog
(cherry picked from commit 07cb749e04)
2018-01-03 13:45:00 -08:00
kerams
4aa8d72644 Fix deliver_get field in rabbitmq input (#3633)
(cherry picked from commit acea7109d4)
2018-01-03 13:44:55 -08:00
Daniel Nelson
384ef6af6b Update changelog
(cherry picked from commit 81f42e8b17)
2018-01-02 16:36:18 -08:00
Daniel Nelson
07985e6524 Add information about how to set permissions for postfix input (#3594)
(cherry picked from commit a440ed8d8c)
2018-01-02 14:10:00 -08:00
Daniel Nelson
f8597f78f4 Update changelog
(cherry picked from commit 06c21fb9f7)
2017-12-28 16:24:26 -08:00
Daniel Nelson
83faea7a31 Set content-type charset in influxdb output and allow it be overridden (#3593)
(cherry picked from commit 4f7afb8cb5)
2017-12-28 16:24:21 -08:00
Daniel Nelson
223bbf0df7 Update changelog
(cherry picked from commit ef6e5c5a85)
2017-12-28 16:19:34 -08:00
Daniel Nelson
55f35f291d Fix DC/OS login expiration time (#3625)
(cherry picked from commit 005face7c0)
2017-12-28 16:19:25 -08:00
Daniel Nelson
6852231c1b Update changelog
(cherry picked from commit 1011cd0c94)
2017-12-28 16:16:30 -08:00
Daniel Nelson
ce4ca43a5d Fix name error in jolokia2_agent sample config (#3624)
(cherry picked from commit 6c075c4346)
2017-12-28 16:16:30 -08:00
timhallinflux
5d6622eb44 Update README.md
added `network` for a tiny bit more context
2017-12-14 14:58:37 -08:00
Daniel Nelson
a1668bbf9a Set release date for 1.5.0 2017-12-14 10:59:13 -08:00
Daniel Nelson
fe91c779e9 Remove AWS credential check from cloudwatch output (#3583)
This method is reported to not work with IAM Instance Profiles, and we
do not want to make any calls that would require additional permissions.

(cherry picked from commit 5b40173bcb)
2017-12-13 17:52:45 -08:00
Daniel Nelson
425b6f7d63 Update changelog
(cherry picked from commit 15266bb7eb)
2017-12-13 11:18:34 -08:00
Ildar Svetlov
c322ddb4b0 Don't add system input uptime_format as a counter (#3578)
(cherry picked from commit d935dfa9ed)
2017-12-13 11:17:55 -08:00
Daniel Nelson
648d3bde33 Update changelog
(cherry picked from commit ff634c5056)
2017-12-13 10:58:16 -08:00
Daniel Nelson
d8da77cb42 Add idle state to processes test
(cherry picked from commit 14b31a2354)
2017-12-13 10:57:28 -08:00
Ted Zlatanov
fdb04702eb Support I (idle) process state on procfs+Linux (#3530)
(cherry picked from commit 663a5b1f50)
2017-12-13 10:56:47 -08:00
Steve Banik
ecf43f4986 Fixed typo in README.md (#3574)
(cherry picked from commit d7d224d511)
2017-12-12 11:22:33 -08:00
Daniel Nelson
e307e92e86 Update changelog
(cherry picked from commit abcad439eb)
2017-12-11 18:02:35 -08:00
Daniel Nelson
8d4a09c3ea Fix separation of multiple prometheus_client outputs (#3570)
(cherry picked from commit 8484de6c12)
2017-12-11 18:02:30 -08:00
Daniel Nelson
fd964bd4eb Use auto type detection for scanned devices in smart input (#3561)
(cherry picked from commit 93d16a4603)
2017-12-08 18:03:39 -08:00
Daniel Nelson
994e75f1f0 Update changelog
(cherry picked from commit 88746b01c3)
2017-12-08 18:02:17 -08:00
Daniel Nelson
2e2efafbfc Update sarama-cluster to latest release (#3560)
(cherry picked from commit 37095ef47d)
2017-12-08 18:02:17 -08:00
Daniel Nelson
39537ed86e Use device name instead of abs path for devices tag in smart input (#3550)
(cherry picked from commit 574034c301)
2017-12-08 13:26:15 -08:00
Daniel Nelson
558ce25c94 Log connect error only in wavefront output (#3549)
(cherry picked from commit 177e7e2c73)
2017-12-06 14:56:28 -08:00
Daniel Nelson
0438f412a9 Fix formatting in changelog 2017-12-04 13:17:23 -08:00
25 changed files with 127 additions and 69 deletions

View File

@@ -1,4 +1,15 @@
## v1.5 [unreleased]
## v1.5.1 [2017-01-10]
### 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.
- [#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]
### New Plugins
- [basicstats](./plugins/aggregators/basicstats/README.md) - Thanks to @toni-moreno
@@ -9,7 +20,7 @@
- [nginx_plus](./plugins/inputs/nginx_plus/README.md) - Thanks to @mplonka & @poblahblahblah
- [opensmtpd](./plugins/inputs/opensmtpd/README.md) - Thanks to @aromeyer
- [particle](./plugins/inputs/webhooks/particle/README.md) - Thanks to @davidgs
- [pf](./plugins/inputs/pf/README.md) Thanks to @nferch
- [pf](./plugins/inputs/pf/README.md) - Thanks to @nferch
- [postfix](./plugins/inputs/postfix/README.md) - Thanks to @phemmer
- [smart](./plugins/inputs/smart/README.md) - Thanks to @rickard-von-essen
- [solr](./plugins/inputs/solr/README.md) - Thanks to @ljagiello
@@ -78,6 +89,7 @@
- [#3140](https://github.com/influxdata/telegraf/pull/3140): Add support for glob patterns in net input plugin.
- [#3405](https://github.com/influxdata/telegraf/pull/3405): Add input plugin for OpenBSD/FreeBSD pf.
- [#3528](https://github.com/influxdata/telegraf/pull/3528): Add option to amqp output to publish persistent messages.
- [#3530](https://github.com/influxdata/telegraf/pull/3530): Support I (idle) process state on procfs+Linux.
### Bugfixes
@@ -92,6 +104,9 @@
- [#3263](https://github.com/influxdata/telegraf/issues/3263): Fix snmp-tools output parsing with Windows EOLs.
- [#3447](https://github.com/influxdata/telegraf/issues/3447): Add shadow-utils dependency to rpm package.
- [#3448](https://github.com/influxdata/telegraf/issues/3448): Use deb-systemd-invoke to restart service.
- [#3553](https://github.com/influxdata/telegraf/issues/3553): Fix kafka_consumer outside range of offsets error.
- [#3568](https://github.com/influxdata/telegraf/issues/3568): Fix separation of multiple prometheus_client outputs.
- [#3577](https://github.com/influxdata/telegraf/issues/3577): Don't add system input uptime_format as a counter.
## v1.4.5 [2017-12-01]

4
Godeps
View File

@@ -4,7 +4,7 @@ github.com/amir/raidman c74861fe6a7bb8ede0a010ce4485bdbb4fc4c985
github.com/apache/thrift 4aaa92ece8503a6da9bc6701604f69acf2b99d07
github.com/aws/aws-sdk-go c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
github.com/bsm/sarama-cluster ccdc0803695fbce22f1706d04ded46cd518fd832
github.com/bsm/sarama-cluster abf039439f66c1ce78017f560b490612552f6472
github.com/cenkalti/backoff b02f2bbce11d7ea6b97f282ef1771b0fe2f65ef3
github.com/couchbase/go-couchbase bfe555a140d53dc1adf390f1a1d4b0fd4ceadb28
github.com/couchbase/gomemcached 4a25d2f4e1dea9ea7dd76dfd943407abf9b07d29
@@ -65,7 +65,7 @@ github.com/samuel/go-zookeeper 1d7be4effb13d2d908342d349d71a284a7542693
github.com/satori/go.uuid 5bf94b69c6b68ee1b541973bb8e1144db23a194b
github.com/shirou/gopsutil 384a55110aa5ae052eb93ea94940548c1e305a99
github.com/shirou/w32 3c9377fc6748f222729a8270fe2775d149a249ad
github.com/Shopify/sarama c01858abb625b73a3af51d0798e4ad42c8147093
github.com/Shopify/sarama 3b1b38866a79f06deddf0487d5c27ba0697ccd65
github.com/Sirupsen/logrus 61e43dc76f7ee59a82bdf3d71033dc12bea4c77d
github.com/soniah/gosnmp 5ad50dc75ab389f8a1c9f8a67d3a1cd85f67ed15
github.com/StackExchange/wmi f3e2bae1e0cb5aef83e319133eabfee30013a4a5

View File

@@ -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 \

View File

@@ -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"]

View File

@@ -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)
}
}

View File

@@ -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.

View File

@@ -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)

View File

@@ -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"]

View File

@@ -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"

View File

@@ -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

View File

@@ -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"`

View File

@@ -129,7 +129,7 @@ the configuration to execute that.
Example output from an _Apple SSD_:
```
> smart_attribute,serial_no=S1K5NYCD964433,wwn=5002538655584d30,id=199,name=UDMA_CRC_Error_Count,flags=-O-RC-,fail=-,host=mbpro.local,device=/dev/rdisk0 threshold=0i,raw_value=0i,exit_status=0i,value=200i,worst=200i 1502536854000000000
> smart_attribute,device=/dev/rdisk0,serial_no=S1K5NYCD964433,wwn=5002538655584d30,id=240,name=Unknown_SSD_Attribute,flags=-O---K,fail=-,host=mbpro.local exit_status=0i,value=100i,worst=100i,threshold=0i,raw_value=0i 1502536854000000000
> smart_device,enabled=Enabled,host=mbpro.local,device=/dev/rdisk0,model=APPLE\ SSD\ SM0512F,serial_no=S1K5NYCD964433,wwn=5002538655584d30,capacity=500277790720 udma_crc_errors=0i,exit_status=0i,health_ok=true,read_error_rate=0i,temp_c=40i 1502536854000000000
> smart_attribute,serial_no=S1K5NYCD964433,wwn=5002538655584d30,id=199,name=UDMA_CRC_Error_Count,flags=-O-RC-,fail=-,host=mbpro.local,device=rdisk0 threshold=0i,raw_value=0i,exit_status=0i,value=200i,worst=200i 1502536854000000000
> smart_attribute,device=rdisk0,serial_no=S1K5NYCD964433,wwn=5002538655584d30,id=240,name=Unknown_SSD_Attribute,flags=-O---K,fail=-,host=mbpro.local exit_status=0i,value=100i,worst=100i,threshold=0i,raw_value=0i 1502536854000000000
> smart_device,enabled=Enabled,host=mbpro.local,device=rdisk0,model=APPLE\ SSD\ SM0512F,serial_no=S1K5NYCD964433,wwn=5002538655584d30,capacity=500277790720 udma_crc_errors=0i,exit_status=0i,health_ok=true,read_error_rate=0i,temp_c=40i 1502536854000000000
```

View File

@@ -3,6 +3,7 @@ package smart
import (
"fmt"
"os/exec"
"path"
"regexp"
"strconv"
"strings"
@@ -134,7 +135,7 @@ func (m *Smart) scan() ([]string, error) {
devices := []string{}
for _, line := range strings.Split(string(out), "\n") {
dev := strings.Split(line, "#")
dev := strings.Split(line, " ")
if len(dev) > 1 && !excludedDev(m.Excludes, strings.TrimSpace(dev[0])) {
devices = append(devices, strings.TrimSpace(dev[0]))
}
@@ -178,13 +179,13 @@ func exitStatus(err error) (int, error) {
return 0, err
}
func gatherDisk(acc telegraf.Accumulator, usesudo, attributes bool, path, nockeck, device string, wg *sync.WaitGroup) {
func gatherDisk(acc telegraf.Accumulator, usesudo, attributes bool, smartctl, nockeck, device string, wg *sync.WaitGroup) {
defer wg.Done()
// smartctl 5.41 & 5.42 have are broken regarding handling of --nocheck/-n
args := []string{"--info", "--health", "--attributes", "--tolerance=verypermissive", "-n", nockeck, "--format=brief"}
args = append(args, strings.Split(device, " ")...)
cmd := sudo(usesudo, path, args...)
cmd := sudo(usesudo, smartctl, args...)
out, e := internal.CombinedOutputTimeout(cmd, time.Second*5)
outStr := string(out)
@@ -196,7 +197,8 @@ func gatherDisk(acc telegraf.Accumulator, usesudo, attributes bool, path, nockec
}
device_tags := map[string]string{}
device_tags["device"] = strings.Split(device, " ")[0]
device_node := strings.Split(device, " ")[0]
device_tags["device"] = path.Base(device_node)
device_fields := make(map[string]interface{})
device_fields["exit_status"] = exitStatus
@@ -240,7 +242,8 @@ func gatherDisk(acc telegraf.Accumulator, usesudo, attributes bool, path, nockec
tags := map[string]string{}
fields := make(map[string]interface{})
tags["device"] = strings.Split(device, " ")[0]
device_node := strings.Split(device, " ")[0]
tags["device"] = path.Base(device_node)
if serial, ok := device_tags["serial_no"]; ok {
tags["serial_no"] = serial

View File

@@ -89,7 +89,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "1",
@@ -107,7 +107,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "5",
@@ -125,7 +125,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "9",
@@ -143,7 +143,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "12",
@@ -161,7 +161,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "169",
@@ -179,7 +179,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "173",
@@ -197,7 +197,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "190",
@@ -215,7 +215,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "192",
@@ -233,7 +233,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "194",
@@ -251,7 +251,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "197",
@@ -269,7 +269,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "199",
@@ -287,7 +287,7 @@ func TestGatherAttributes(t *testing.T) {
"exit_status": int(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
"id": "240",
@@ -317,7 +317,7 @@ func TestGatherAttributes(t *testing.T) {
"udma_crc_errors": int64(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"model": "APPLE SSD SM256E",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",
@@ -363,7 +363,7 @@ func TestGatherNoAttributes(t *testing.T) {
"udma_crc_errors": int64(0),
},
map[string]string{
"device": "/dev/ada0",
"device": "ada0",
"model": "APPLE SSD SM256E",
"serial_no": "S0X5NZBC422720",
"wwn": "5002538043584d30",

View File

@@ -30,7 +30,7 @@ Using the environment variable `HOST_PROC` the plugin will retrieve process info
- zombie
- dead
- wait (freebsd only)
- idle (bsd only)
- idle (bsd and Linux 4+ only)
- paging (linux only)
- total_threads (linux only)
@@ -47,7 +47,7 @@ Linux FreeBSD Darwin meaning
Z Z Z zombie
X none none dead
T T T stopped
none I I idle (sleeping for longer than about 20 seconds)
I I I idle (sleeping for longer than about 20 seconds)
D D,L U blocked (waiting in uninterruptible sleep, or locked)
W W none paging (linux kernel < 2.6 only), wait (freebsd)
```

View File

@@ -34,5 +34,6 @@ $ telegraf --config ~/ws/telegraf.conf --input-filter system --test
* Plugin: system, Collection 1
* Plugin: inputs.system, Collection 1
> system,host=tyrion load1=3.72,load5=2.4,load15=2.1,n_users=3i,n_cpus=4i 1483964144000000000
> system,host=tyrion uptime=1249632i,uptime_format="14 days, 11:07" 1483964144000000000
> system,host=tyrion uptime=1249632i 1483964144000000000
> system,host=tyrion uptime_format="14 days, 11:07" 1483964144000000000
```

View File

@@ -85,6 +85,7 @@ func getEmptyFields() map[string]interface{} {
fields["dead"] = int64(0)
fields["paging"] = int64(0)
fields["total_threads"] = int64(0)
fields["idle"] = int64(0)
}
return fields
}
@@ -174,6 +175,8 @@ func (p *Processes) gatherFromProc(fields map[string]interface{}) error {
fields["stopped"] = fields["stopped"].(int64) + int64(1)
case 'W':
fields["paging"] = fields["paging"].(int64) + int64(1)
case 'I':
fields["idle"] = fields["idle"].(int64) + int64(1)
default:
log.Printf("I! processes: Unknown state [ %s ] in file %s",
string(stats[0][0]), filename)

View File

@@ -44,7 +44,8 @@ func TestFromPS(t *testing.T) {
fields["zombies"] = int64(1)
fields["running"] = int64(4)
fields["sleeping"] = int64(34)
fields["total"] = int64(43)
fields["idle"] = int64(2)
fields["total"] = int64(45)
acc.AssertContainsTaggedFields(t, "processes", fields, map[string]string{})
}
@@ -172,6 +173,8 @@ U
Z
D
S+
I
I
`
const testProcStat = `10 (rcuob/0) %s 2 0 0 0 -1 2129984 0 0 0 0 0 0 0 0 20 0 %s 0 11 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744073709551615 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View File

@@ -46,7 +46,9 @@ func (_ *SystemStats) Gather(acc telegraf.Accumulator) error {
"n_cpus": runtime.NumCPU(),
}, nil)
acc.AddCounter("system", map[string]interface{}{
"uptime": hostinfo.Uptime,
"uptime": hostinfo.Uptime,
}, nil)
acc.AddFields("system", map[string]interface{}{
"uptime_format": format_uptime(hostinfo.Uptime),
}, nil)

View File

@@ -284,7 +284,7 @@ if any of the combinations of ObjectName/Instances/Counters are invalid.
```
### .NET Montioring
### .NET Monitoring
```
[[inputs.win_perf_counters.object]]
# .NET CLR Exceptions, in this case for IIS only

View File

@@ -9,7 +9,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/influxdata/telegraf"
internalaws "github.com/influxdata/telegraf/internal/config/aws"
@@ -71,20 +70,7 @@ func (c *CloudWatch) Connect() error {
Token: c.Token,
}
configProvider := credentialConfig.Credentials()
stsService := sts.New(configProvider)
params := &sts.GetSessionTokenInput{}
_, err := stsService.GetSessionToken(params)
if err != nil {
log.Printf("E! cloudwatch: Cannot use credentials to connect to AWS : %+v \n", err.Error())
return err
}
c.svc = cloudwatch.New(configProvider)
return nil
}

View File

@@ -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

View File

@@ -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)

View File

@@ -79,19 +79,28 @@ var sampleConfig = `
`
func (p *PrometheusClient) Start() error {
prometheus.Register(p)
defaultCollectors := map[string]bool{
"gocollector": true,
"process": true,
}
for _, collector := range p.CollectorsExclude {
delete(defaultCollectors, collector)
}
registry := prometheus.NewRegistry()
for collector, _ := range defaultCollectors {
switch collector {
case "gocollector":
prometheus.Unregister(prometheus.NewGoCollector())
registry.Register(prometheus.NewGoCollector())
case "process":
prometheus.Unregister(prometheus.NewProcessCollector(os.Getpid(), ""))
registry.Register(prometheus.NewProcessCollector(os.Getpid(), ""))
default:
return fmt.Errorf("unrecognized collector %s", collector)
}
}
registry.Register(p)
if p.Listen == "" {
p.Listen = "localhost:9273"
}
@@ -102,8 +111,7 @@ func (p *PrometheusClient) Start() error {
mux := http.NewServeMux()
mux.Handle(p.Path, promhttp.HandlerFor(
prometheus.DefaultGatherer,
promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}))
registry, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}))
p.server = &http.Server{
Addr: p.Listen,

View File

@@ -101,11 +101,13 @@ func (w *Wavefront) Connect() error {
uri := fmt.Sprintf("%s:%d", w.Host, w.Port)
_, err := net.ResolveTCPAddr("tcp", uri)
if err != nil {
return fmt.Errorf("Wavefront: TCP address cannot be resolved %s", err.Error())
log.Printf("Wavefront: TCP address cannot be resolved %s", err.Error())
return nil
}
connection, err := net.Dial("tcp", uri)
if err != nil {
return fmt.Errorf("Wavefront: TCP connect fail %s", err.Error())
log.Printf("Wavefront: TCP connect fail %s", err.Error())
return nil
}
defer connection.Close()
return nil