Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
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?
Solved! See The Solution
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
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"
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.
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