Merge branch 'master' into pg-compat

Conflicts:
	CHANGELOG.md
This commit is contained in:
Kevin Bouwkamp 2015-09-14 20:58:52 -04:00
commit 1529412abc
4 changed files with 11 additions and 5 deletions

View File

@ -14,6 +14,7 @@ will still be backwards compatible if only `url` is specified.
- [#178](https://github.com/influxdb/telegraf/issues/178): redis plugin, multiple server thread hang bug - [#178](https://github.com/influxdb/telegraf/issues/178): redis plugin, multiple server thread hang bug
- Fix net plugin on darwin - Fix net plugin on darwin
- [#84](https://github.com/influxdb/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee! - [#84](https://github.com/influxdb/telegraf/issues/84): Fix docker plugin on CentOS. Thanks @neezgee!
- [#189](https://github.com/influxdb/telegraf/pull/189): Fix mem_used_perc. Thanks @mced!
- [#192](https://github.com/influxdb/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+ - [#192](https://github.com/influxdb/telegraf/issues/192): Increase compatibility of postgresql plugin. Now supports versions 8.1+
## v0.1.8 [2015-09-04] ## v0.1.8 [2015-09-04]

View File

@ -14,6 +14,7 @@ const DefaultURL = "http://localhost:15672"
type Server struct { type Server struct {
URL string URL string
Name string
Username string Username string
Password string Password string
Nodes []string Nodes []string
@ -70,6 +71,7 @@ type Node struct {
var sampleConfig = ` var sampleConfig = `
# Specify servers via an array of tables # Specify servers via an array of tables
[[rabbitmq.servers]] [[rabbitmq.servers]]
# name = "rmq-server-1" # optional tag
# url = "http://localhost:15672" # url = "http://localhost:15672"
# username = "guest" # username = "guest"
# password = "guest" # password = "guest"
@ -117,7 +119,10 @@ func (r *RabbitMQ) gatherServer(serv *Server, acc plugins.Accumulator) error {
return err return err
} }
tags := map[string]string{} tags := map[string]string{"url": serv.URL}
if serv.Name != "" {
tags["name"] = serv.Name
}
acc.Add("messages", overview.QueueTotals.Messages, tags) acc.Add("messages", overview.QueueTotals.Messages, tags)
acc.Add("messages_ready", overview.QueueTotals.MessagesReady, tags) acc.Add("messages_ready", overview.QueueTotals.MessagesReady, tags)
@ -147,7 +152,7 @@ func (r *RabbitMQ) gatherServer(serv *Server, acc plugins.Accumulator) error {
continue continue
} }
tags = map[string]string{"node": node.Name} tags["node"] = node.Name
acc.Add("disk_free", node.DiskFree, tags) acc.Add("disk_free", node.DiskFree, tags)
acc.Add("disk_free_limit", node.DiskFreeLimit, tags) acc.Add("disk_free_limit", node.DiskFreeLimit, tags)

View File

@ -45,7 +45,7 @@ func VirtualMemory() (*VirtualMemoryStat, error) {
} }
ret.Available = ret.Free + ret.Buffers + ret.Cached ret.Available = ret.Free + ret.Buffers + ret.Cached
ret.Used = ret.Total - ret.Free ret.Used = ret.Total - ret.Free
ret.UsedPercent = float64(ret.Total-ret.Available) / float64(ret.Total) * 100.0 ret.UsedPercent = float64(ret.Used) / float64(ret.Total) * 100.0
return ret, nil return ret, nil
} }

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/shirou/gopsutil/common" "github.com/influxdb/telegraf/plugins/system/ps/common"
) )
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
@ -26,7 +26,7 @@ func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
// skip first line // skip first line
continue continue
} }
if common.StringsHas(exists, values[0]) { if common.StringContains(exists, values[0]) {
// skip if already get // skip if already get
continue continue
} }