Compare commits
6 Commits
logparser-
...
1.5.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd964bd4eb | ||
|
|
994e75f1f0 | ||
|
|
2e2efafbfc | ||
|
|
39537ed86e | ||
|
|
558ce25c94 | ||
|
|
0438f412a9 |
@@ -9,7 +9,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
|
||||
@@ -92,6 +92,7 @@
|
||||
- [#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.
|
||||
|
||||
## v1.4.5 [2017-12-01]
|
||||
|
||||
|
||||
4
Godeps
4
Godeps
@@ -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
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user