Forum Discussion

FTD_Routing_Hyd's avatar
FTD_Routing_Hyd
Icon for Nimbostratus rankNimbostratus
Dec 07, 2016
Solved

How to check active connections in icontrol ?

Hi, I need a help regarding F5 icontrol... When I disable a node using icontrol in powershell,it is disabled.I want to check the current connections on that node after disabling,I mean post disabling the node,for how much time it will have active connections ?I cannot find any predefined command in icontrol cmdlets for checking the active connections. Can anyone help ?

 

  • Please use iControl REST API with

    Invoke-RestMethod
    like below with your
    username
    ,
    password
    and
    bigip
    .

    PS> $securePwd = ConvertTo-SecureString "password" -AsPlainText -Force
    PS> $credential = New-Object System.Management.Automation.PSCredential("username",$securePwd)
    

    you can see nodename list

    PS> Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/stats -Credential $credential | Format-List
    

    And you can see the stats of specified node with

    PS> Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/{target-nodename}/stats -Credential $credential | Format-List
    

18 Replies

  • Try this and you can see nodename list

    Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/stats -Credential $credential | Format-List
    

    And you can see the stats of specified node with

    Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/{target-nodename}/stats -Credential $credential | Format-List
    
  • Hi Uchi, It seems to be working :) Thanks a lot!!!

     

    In the same way, can we check the virtual server and pool stats or are there any other commands or syntaxes ?

     

  • Please use iControl REST API with

    Invoke-RestMethod
    like below with your
    username
    ,
    password
    and
    bigip
    .

    PS> $securePwd = ConvertTo-SecureString "password" -AsPlainText -Force
    PS> $credential = New-Object System.Management.Automation.PSCredential("username",$securePwd)
    

    you can see nodename list

    PS> Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/stats -Credential $credential | Format-List
    

    And you can see the stats of specified node with

    PS> Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/{target-nodename}/stats -Credential $credential | Format-List
    
    • FTD_Routing_Hyd's avatar
      FTD_Routing_Hyd
      Icon for Nimbostratus rankNimbostratus

      Thanks for the help Thanks a lot!!!

       

      But I will surely trouble you,if I need more help ;)

       

      Regards

       

    • FTD_Routing_Hyd's avatar
      FTD_Routing_Hyd
      Icon for Nimbostratus rankNimbostratus

      Hi Uchi, I ran the following command to check the current connections on a active node .....where, I replaced bigip with bigip ip address and replaced target node with the node name

       

      Invoke-RestMethod -Uri {target node}/stats -Credential $credential | Format-List

       

      The following is the result the I am receiving post executing the above command..

       

      kind : tm:ltm:node:nodestatsgeneration : 1selfLink : {target node}/stats?ver=11.6.1entries : @{addr=; curSessions=; monitorRule=; monitorStatus=; tmName=; serverside.bitsIn=; serverside.bitsOut=; serverside.curConns=; serverside.totConns=; sessionStatus=; status.availabilityState=; status.enabledState=; status.statusReason=; totRequests=}

       

      So, do I need to add any of the above entries in the Invoke-Restmethod command or here itself should I see all the node stats.

       

      Please bear with me,as I am new to API

       

      Thanks

       

    • uchi_122495's avatar
      uchi_122495
      Icon for Cirrus rankCirrus

      You have already get all the node stats. Please change

      Format-List
      to
      ConvertTo-Json -Depth 10
      and then you can see all of data recursively.