Forum Discussion
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
like below with yourInvoke-RestMethod
,username
andpassword
.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
- uchi_122495Cirrus
- FTD_Routing_HydNimbostratus
Hi Uchi, I found the above post.My Big-ip product version is 11.6.1. The command - Invoke-RestMethod -Method GET -Uri '$select=addr,curSessions' is not working , to be more specific - when I type Invoke- and press tab the 'Restmethod' word is not populating
Appreciate your prompt reply
- uchi_122495Cirrus
is new command added from PowerShell v3. Is it installed on your client PC?Invoke-RestMethod
- FTD_Routing_HydNimbostratus
I am running Powershell v1.Is there any command for v1 to check the current connections ?
- uchi_122495Cirrus
I don't know a lot about PS1. But I think there is a way to call http request from PS1.
- FTD_Routing_HydNimbostratus
Hi Uchi,
I am getting the following error...
==========================================================
Please let me know,where I am going wrong
- uchi_122495Cirrus
What error message did you get?
Could you try accessing that uri with browser?
- FTD_Routing_HydNimbostratus
Thanks for your prompt reply,Uchi
This is the error -
Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
The URI is accessible via browser
Thanks
- uchi_122495Cirrus
I guess
doesn't allow the syntaxInvoke-RestMethod
for basic auth. Please try below with yourhttps://username:password@bigip
,username
andpassword
.bigip
PS> $securePwd = ConvertTo-SecureString "password" -AsPlainText -Force PS> $credential = New-Object System.Management.Automation.PSCredential("username",$securePwd) PS> Invoke-RestMethod -Uri https://bigip/mgmt/tm/ltm/node/stats -Credential $credential
- FTD_Routing_HydNimbostratus
Hi Uchi,
The above syntax worked.. Thanks for the help!
But,post running 'Invoke-RestMethod -Uri -Credential $credential',I receive the below results.
kind selfLink entries
tm:ltm:node:nodecollectionstats ... @{...
How to go ahead,if I want to check the active connections on a particular node ?
Recent Discussions
Related Content
* 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