For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

JulienDebbia_20's avatar
JulienDebbia_20
Icon for Nimbostratus rankNimbostratus
Jun 23, 2015

How 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 need to know is how can I get more informations (new sessions, etc.)

 

Thank you.

 

Best regards

 

2 Replies

  • You 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"}}