diff --git a/plugins/inputs/rabbitmq/rabbitmq.go b/plugins/inputs/rabbitmq/rabbitmq.go index 837fb35580fce..18ea872c69061 100644 --- a/plugins/inputs/rabbitmq/rabbitmq.go +++ b/plugins/inputs/rabbitmq/rabbitmq.go @@ -140,7 +140,7 @@ type Node struct { RunQueue int64 `json:"run_queue"` SocketsTotal int64 `json:"sockets_total"` SocketsUsed int64 `json:"sockets_used"` - Running int64 `json:"running"` + Running bool `json:"running"` } type Exchange struct { @@ -337,6 +337,11 @@ func gatherNodes(r *RabbitMQ, acc telegraf.Accumulator) { tags := map[string]string{"url": r.URL} tags["node"] = node.Name + var running int64 = 0 + if node.Running { + running = 1 + } + fields := map[string]interface{}{ "disk_free": node.DiskFree, "disk_free_limit": node.DiskFreeLimit, @@ -349,7 +354,7 @@ func gatherNodes(r *RabbitMQ, acc telegraf.Accumulator) { "run_queue": node.RunQueue, "sockets_total": node.SocketsTotal, "sockets_used": node.SocketsUsed, - "running": node.Running, + "running": running, } acc.AddFields("rabbitmq_node", fields, tags, now) }