Cisco MDS login and show commands (wodSSH / wodSSH.NET)
I'm trying to write a basic VB program using Visual Studio 2005.
The goal is to telnet or SSH to a Cisco MDS Fiber Channel Switch, and run some basic commands, which will eventually be sent to a text file.
This is what I see when I telnet or SSH using SecureCRT.
--------- Start Paste ----------------
MDS-Top login: admin
Password:
Cisco Storage Area Networking Operating System (SAN-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2005, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.
MDS-Top# show version
Cisco Storage Area Networking Operating System (SAN-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2005, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.
Software
BIOS: version 1.1.0
loader: version 1.2(2)
kickstart: version 2.1(1b)
system: version 2.1(1b)
BIOS compile time: 10/24/03
kickstart image file is: bootflash:/m9200-ek9-kickstart-mz.2.1.1b.bin
kickstart compile time: 7/19/2005 20:00:00 [07/26/2005 17:29:49]
system image file is: bootflash:/m9200-ek9-mz.2.1.1b.bin
system compile time: 7/19/2005 20:00:00 [07/26/2005 17:49:06]
Hardware
cisco MDS 9216 ( 2x1GE IPS, 14x1/2Gbps FC/Supervisor )
Intel(R) Pentium(R) III CPU - with 964000 kB of memory.
Processor Board ID JAB0941037A
bootflash: 500736 blocks (block size 512b)
slot0: 0 blocks (block size 512b)
MDS-Top kernel uptime is 8 days 20 hours 5 minute(s) 46 second(s)
Last reset at 322491 usecs after Tue Jan 17 23:20:55 2006
Reason: Reset Requested by CLI command reload
System version: 2.1(1b)
Service:
MDS-Top#
--------- End Paste ---------
Presently this the code I'm using
------- Start Paste ---------
Public Class Form1
Dim WithEvents Ssh1 As WeOnlyDo.Client.SSH
Public SSHCommand As String = show version
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Ssh1 = New WeOnlyDo.Client.SSH() ' Initialize new instance
Ssh1.Blocking = True
Ssh1.Login = admin ' Set your login/username
Ssh1.Password = password ' Set your password
Ssh1.Encryption = WeOnlyDo.Client.SSH.EncryptionMethods.Auto ' Any encryption is ok
' Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.Telnet
Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSH1 ' Set SSH version
Ssh1.Prompt = MDS-Top#
Ssh1.Hostname = 1.1.1.1
Ssh1.Connect( 1.1.1.1 ) ' Connect, finally. Now wait for Connected event to occur
'Ssh1.WaitFor( MDS-Top# , 5)
'Ssh1.Execute( show version , MDS-Top# , 5)
'Ssh1.Execute( show version & Chr(10), # , 5)
TextBox1.Text = Ssh1.Receive
End Sub
End Class
--------- End Paste ----------
When I run it (as it stands right now) I get all of the output upto an d including MDS-Top# . However when I uncomment any of the Ssh1.Execute commands I get a timeout due to in activity.
If I attempt to add Ssh1.command= show version & vblf It tells me that the stdin: line is not tty
What the heck am I missing? It probably easy, but I haven't messed around with VB for a couple of years and the old brain doesn't ramp up as quickly as it used to.
Any help is appreciated.
Thanks
VBRookie