Forum Discussion
Kevin_K_51432
Apr 13, 2017Historic F5 Account
Greetings, I've had good luck using most of the Rest API by simply appending "stats" to the end of a query. I'm by not means an expert here, but I do use Rest quite often due to its simplicity:
So I would grab the stats for a pool named "default_gw" using the following:
curl -sk -u admin:admin https://172.24.64.39/mgmt/tm/ltm/pool/~Common~default_gw/members/~Common~10.12.23.27:0/stats
The output would be similar to:
"generation":1
"selfLink":"https://localhost/mgmt/tm/ltm/pool/~Common~default_gw/members/~Common~10.12.23.27:0/stats?ver=12.0.0"
"entries":{"https://localhost/mgmt/tm/ltm/pool/~Common~default_gw/members/~Common~10.12.23.27:0/~Common~10.12.23.27:0/stats":{"nestedStats":{"kind":"tm:ltm:pool:members:membersstats"
"selfLink":"https://localhost/mgmt/tm/ltm/pool/~Common~default_gw/members/~Common~10.12.23.27:0/~Common~10.12.23.27:0/stats?ver=12.0.0"
"entries":{"addr":{"description":"10.12.23.27"}
"connq.ageEdm":{"value":0}
"connq.ageEma":{"value":0}
"connq.ageHead":{"value":0}
"connq.ageMax":{"value":0}
"connq.depth":{"value":0}
"connq.serviced":{"value":0}
"curSessions":{"value":0}
"monitorRule":{"description":"/Common/gateway_icmp (pool monitor)"}
"monitorStatus":{"description":"up"}
"nodeName":{"description":"/Common/10.12.23.27"}
"poolName":{"description":"/Common/default_gw"}
"port":{"value":0}
"serverside.bitsIn":{"value":175344}
"serverside.bitsOut":{"value":215808}
"serverside.curConns":{"value":0}
"serverside.maxConns":{"value":10}
"serverside.pktsIn":{"value":334}
"serverside.pktsOut":{"value":240}
"serverside.totConns":{"value":94}
"sessionStatus":{"description":"enabled"}
"status.availabilityState":{"description":"available"}
"status.enabledState":{"description":"enabled"}
"status.statusReason":{"description":"Pool member is available"}
"totRequests":{"value":0}}}}}}
- syncretismApr 13, 2017Nimbostratus
Stats! I knew I had that somewhere in my notes. This is great - I'm passing the JSON object to jq and watching the number of connections in my script. Just what I needed. Thanks so much!
- Kevin_K_51432Apr 13, 2017Historic F5 Account
I was equally happy at discovering this one =) You're very welcome, glad this was helpful!