Microsoft Virtualization Discussions

PSTK Cmdlet Request

NickSnyder
2,325 Views

Desire a PowerShell equivalent of the following CLI command and/or similar.  

ontap::> network connections active show -vserver myvserver -lif-name mylifname

ontap::> 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

 

2 REPLIES 2

mbeattie
2,302 Views

Hi Nick,

 

I'll pass the request on, in the meantime it would be possible to write a function using "Invoke-NcSystemApi" as a wrapper around the CLI. The advantage of using Invoke-NcSystemApi is that it's via HTTPS only and doesn't require SSH. Here are a few "examples".

 

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Re-Issue-with-Invoke-NcSystemApi/td-p/142273

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5P1-released/td-p/138566/page/2

 

/Matt

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

JohnChampion
2,208 Views

...or use Invoke-NcSsh if your environment allows SSH sessions...

PS C:\WINDOWS\system32> Invoke-NcSsh -Command "network connections active show -vserver Cluster"

NcController : 10.0.10.13
Value        :

               Last login time: 6/7/2019 15:58:16

               Vserver    Interface              Remote
               Name       Name:Local Port        Host:Port                    Protocol/Service
               ---------- ---------------------- ---------------------------- ----------------
               Node: master-01
               Cluster    master-01_clus2:7700   169.254.205.30:17997         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18013         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18015         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18007         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18009         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18005         TCP/ctlopcp
               Cluster    master-01_clus2:7700   169.254.205.30:18011         TCP/ctlopcp
               Cluster    master-01_clus1:7700   169.254.27.248:18006         TCP/ctlopcp
               Cluster    master-01_clus1:7700   169.254.27.248:18014         TCP/ctlopcp

 

 

Public