Software Development Kit (SDK) and API Discussions

Powershell ONTAP 9.6 | "network connection active show"

PMensing
3,666 Views

Hello, everyone,
I am looking for the PowerShell cmdlet that performs the ONTAP command "network connection active show". Does anyone have an idea how I can get it to work in PowerShell?

1 ACCEPTED SOLUTION

donny_lang
3,570 Views

That cmdlet is just sending an SSH command to the cluster, so you can filter it the same way you can filter within the ONTAP CLI: 

 

lab-clst-01::> network connections active show ?
[ -instance | -print-ip-addresses | -fields <fieldname>, ... ]
[[-node] <nodename>] Node
[[-cid] <Cid>] Connection ID
[ -vserver <vserver> ] Vserver
[ -lif-name <lif-name> ] Logical Interface Name
[ -local-address <IP Address> ] Local IP address
[ -local-port <integer> ] Local Port
[ -remote-ip <InetAddress> ] Remote IP Address
[ -remote-host <Remote IP> ] Remote Host
[ -remote-port <integer> ] Remote Port
[ -proto {UDP|TCP} ] Protocol
[ -lifid <integer> ] Logical Interface ID
[ -service <protocol service> ] Protocol Service
[ -lru {yes|no} ] Least Recently Used
[ -blocks-lb {true|false} ] Connection Blocks Load Balance Migrate

View solution in original post

3 REPLIES 3

donny_lang
3,642 Views

I was not able to locate a suitable cmdlet in the PSTK (or an API call, actually) after looking quickly. If your environment allows for SSH, you could use the Invoke-NcSsh command like so (after connecting to a controller, of course): 

 

Invoke-NcSsh -Command "network connections active show" 

 

PMensing
3,572 Views

Hi,

thanks for your answer. What is the best way to filter the whole thing afterwards? If I see it right I will get a long string with all active network connections. I haven't found the right approach to use the data yet.

donny_lang
3,571 Views

That cmdlet is just sending an SSH command to the cluster, so you can filter it the same way you can filter within the ONTAP CLI: 

 

lab-clst-01::> network connections active show ?
[ -instance | -print-ip-addresses | -fields <fieldname>, ... ]
[[-node] <nodename>] Node
[[-cid] <Cid>] Connection ID
[ -vserver <vserver> ] Vserver
[ -lif-name <lif-name> ] Logical Interface Name
[ -local-address <IP Address> ] Local IP address
[ -local-port <integer> ] Local Port
[ -remote-ip <InetAddress> ] Remote IP Address
[ -remote-host <Remote IP> ] Remote Host
[ -remote-port <integer> ] Remote Port
[ -proto {UDP|TCP} ] Protocol
[ -lifid <integer> ] Logical Interface ID
[ -service <protocol service> ] Protocol Service
[ -lru {yes|no} ] Least Recently Used
[ -blocks-lb {true|false} ] Connection Blocks Load Balance Migrate

Public