Forum Discussion
JulienDebbia_20
Nimbostratus
Jun 23, 2015How to get active connections from iControlREST API
Hello,
I would like to know if it is possible to get connections information.
I use this url (https:///mgmt/tm/sys/connection) to get basic informations but it return 0 connections. What I ...
JRahm
Admin
Jun 23, 2015You need to use query parameters. Here are the specific fields you can use:
age Specifies the age, in seconds, of a connection
connection-id
cs-client-addr Specifies the clientside remote address of the active connections
cs-client-port Specifies the clientside remote port of the active connections
cs-server-addr Specifies the clientside local address of the active connections
cs-server-port Specifies the clientside local port of the active connections
protocol Specifies the protocol used for specified connections (for example: tcp, udp)
ss-client-addr Specifies the serverside local address of the active connections
ss-client-port Specifies the serverside local port of the active connections
ss-server-addr Specifies the serverside remote address of the active connections
ss-server-port Specifies the serverside remote port of the active connections
type Specifies the connnection type used for specified connections (for example: any, mirror, self)
So to build the URL for all connections to my 192.168.102.50:80 virtual, it would look like this:
https://172.16.44.128/mgmt/tm/sys/connection?options=cs-server-addr+192.168.102.50+cs-server-port+80
And the returned json is:
{"kind":"tm:sys:connection:connectionstats","selfLink":"https://localhost/mgmt/tm/sys/connection?options=cs-server-addr+192.168.102.50+cs-server-port+80&ver=11.6.0","apiRawValues":{"apiAnonymous":"Sys::Connections\n192.168.102.1:55264 192.168.102.50:80 192.168.102.1:55264 192.168.103.11:80 tcp 3 (tmm: 0) none\n192.168.102.1:55262 192.168.102.50:80 192.168.102.1:55262 192.168.103.11:8080 tcp 1 (tmm: 0) none\n192.168.102.1:55266 192.168.102.50:80 192.168.102.1:55266 192.168.103.10:8080 tcp 2 (tmm: 0) none\n192.168.102.1:55263 192.168.102.50:80 192.168.102.1:55263 192.168.103.10:80 tcp 1 (tmm: 1) none\n192.168.102.1:55261 192.168.102.50:80 192.168.102.1:55261 192.168.103.10:8080 tcp 1 (tmm: 1) none\n192.168.102.1:55265 192.168.102.50:80 192.168.102.1:55265 192.168.103.11:8080 tcp 2 (tmm: 1) none\nTotal records returned: 6\n"}}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects