diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c264cc4..3e70cd98e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 - Fix net plugin on darwin - [#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+ ## v0.1.8 [2015-09-04] diff --git a/plugins/rabbitmq/rabbitmq.go b/plugins/rabbitmq/rabbitmq.go index 55b4b0a95..506e932ad 100644 --- a/plugins/rabbitmq/rabbitmq.go +++ b/plugins/rabbitmq/rabbitmq.go @@ -14,6 +14,7 @@ const DefaultURL = "http://localhost:15672" type Server struct { URL string + Name string Username string Password string Nodes []string @@ -70,6 +71,7 @@ type Node struct { var sampleConfig = ` # Specify servers via an array of tables [[rabbitmq.servers]] + # name = "rmq-server-1" # optional tag # url = "http://localhost:15672" # username = "guest" # password = "guest" @@ -117,7 +119,10 @@ func (r *RabbitMQ) gatherServer(serv *Server, acc plugins.Accumulator) error { 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_ready", overview.QueueTotals.MessagesReady, tags) @@ -147,7 +152,7 @@ func (r *RabbitMQ) gatherServer(serv *Server, acc plugins.Accumulator) error { continue } - tags = map[string]string{"node": node.Name} + tags["node"] = node.Name acc.Add("disk_free", node.DiskFree, tags) acc.Add("disk_free_limit", node.DiskFreeLimit, tags) diff --git a/plugins/system/ps/mem/mem_linux.go b/plugins/system/ps/mem/mem_linux.go index 42a49a2b6..b2519ddd5 100644 --- a/plugins/system/ps/mem/mem_linux.go +++ b/plugins/system/ps/mem/mem_linux.go @@ -45,7 +45,7 @@ func VirtualMemory() (*VirtualMemoryStat, error) { } ret.Available = ret.Free + ret.Buffers + ret.Cached 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 } diff --git a/plugins/system/ps/net/net_darwin.go b/plugins/system/ps/net/net_darwin.go index 7fb21713c..0c518a736 100644 --- a/plugins/system/ps/net/net_darwin.go +++ b/plugins/system/ps/net/net_darwin.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/common" + "github.com/influxdb/telegraf/plugins/system/ps/common" ) func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { @@ -26,7 +26,7 @@ func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { // skip first line continue } - if common.StringsHas(exists, values[0]) { + if common.StringContains(exists, values[0]) { // skip if already get continue }