Strange Returns - WeOnlyDo Discussion board

Strange Returns (wodSSH / wodSSH.NET)

by Simon, Monday, April 27, 2009, 15:30 (5471 days ago)

Hi,

Following the last succeful help, i am going to post another similar question.

We have a router, and a Cisco Unity Express blade in it (this is a linux based computer running in the router.

If i use standard windows telnet it works fine. but when i am using the following code

ssh1.Send( service-module integrated-Service-Engine 1/0 session + vbLf)
System.Threading.Thread.Sleep(1000)
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
ssh1.Send(vbCrLf)
a = ssh1.WaitFor( regex:[#>]$ , 10)
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
pos = 7
ssh1.Send( sh run|include user[0-z ]+ber x224217303x22 & vbCr)
System.Threading.Thread.Sleep(3000)
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
Application.DoEvents()


I am getting wierd responses (as shown below)


service-module integrated-Service-Engine 1/0 session
Trying 10.196.7.2, 2066 ... Open
CC



This is the Milan Router.


No unauthorised access is permitted.

The equipment now being accessed and information available through
this equipment is confidential and proprietary, and may be accessed
or used only as specifically authorized. All other access or use
is prohibited and is subject to legal action.


MILACUE11>>
MILACUE1>
MILACUE11>> sh run|include user[0-z ]+ber x224217303x22
MILACUE11>> sh run|include user[0-z ]+ber x224217303x22 username VMasDDDD phonenumber 4217303

MILACUE1>


As you can see it is listing it twice with some wierd characters in random places.

This does cause issues because i was waiting for the MILACUE1> but it apears many times.

Any help would be most greatful.

Re: Strange Returns

by wodDamir, Monday, April 27, 2009, 15:37 (5471 days ago) @ Simon

Hi Simon,

Can you please try setting StripANSI property to true, before connecting?

I believe this should resolve the problem you are experiencing.

Regards,
Damba

Re: Strange Returns

by Simon, Monday, April 27, 2009, 15:39 (5471 days ago) @ wodDamir

I have already set this
ssh1.Hostname = milrtr1
ssh1.Protocol = SSH.SupportedProtocols.Telnet
ssh1.Blocking = True
ssh1.Protocol = 1 'Telnet
ssh1.Port = 23 ' first Protocol then Port Property
ssh1.Timeout = 120
ssh1.StripANSI = True
pos = 0
a =
Try

Would that stop the line appearing twice?

Re: Strange Returns

by wodDamir, Monday, April 27, 2009, 15:58 (5471 days ago) @ Simon

Simon,

StripANSI should remove ANSK characters from the received data, so that those signs don't appear.

However, can you show me how the output looks like in windows telnet?

Can you try setting TerminalType property to dumb ? Does that help?

You can send us screen capture or files to techsupport@weonlydo.com

Regards,
Damba

Re: Strange Returns

by Simon, Monday, April 27, 2009, 16:33 (5471 days ago) @ wodDamir

Simon,

StripANSI should remove ANSK characters from the received data, so that those signs don't appear.

However, can you show me how the output looks like in windows telnet?

Can you try setting TerminalType property to dumb ? Does that help?

You can send us screen capture or files to techsupport@weonlydo.com

Regards,
Damba


I have tried Dumb and VT220 and it still makes no difference.

I can try a couple others, I have emailed Techsupport a video.

Thanks