parent
bd00f46d8b
commit
11126cf4ae
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue