Virtualization Articles and Resources

Data ONTAP PowerShell Toolkit - Emulate console connection

cknight

How often have you tried to telnet to a Data ONTAP controller, only to be greeted with the message:

 

Too many users logged in!  Please try again later.


C
onnection to host lost.

 

Here is a script that uses the new Invoke-NaSsh cmdlet in Toolkit 1.3 to emulate a console connection.  It works regardless of any other users logged in.  Like Invoke-NaSsh on which it is based, this script accepts a name or address value or an NaController object (argument 0), or the value in $global:CurrentNaController.  Similarly, credentials may be supplied explicitly (argument 1), embedded in an NaController object, or via the credentials cache.  Just enter 'exit' or Ctrl-C to return to PowerShell.

 

PS C:\> Connect-NaController benson
PS C:\> .\Connect-NaControllerConsole.ps1
benson: aggr status
           Aggr State           Status            Options
          aggr0 online          raid_dp, aggr     root
          aggr1 online          raid_dp, aggr

 

benson:

 

Commands that don't terminate on their own, such as sysstat, will cause Invoke-NaSsh to hang.  In a case like that, just ensure the output is bounded:

 

PS C:\> .\Connect-NaControllerConsole.ps1 dunn
dunn: sysstat -c 5
CPU    NFS   CIFS   HTTP      Net kB/s     Disk kB/s      Tape kB/s    Cache
                               in   out     read  write    read write     age
  0%      0      0      0       0     0       16      0       0     0     >60
  0%      0      0      0       0     0        8     24       0     0     >60
  0%      0      0      0       0     0        0      0       0     0     >60
  1%      0      3      0       8     9       40      8       0     0     >60
  1%      0      0      0       0     0        8     24       0     0     >60

 

dunn:

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums
Public