Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-01-2020, 09:32 AM
Amr_Wael Amr_Wael is offline
Registered User
 
Join Date: Jun 2020
Posts: 4
CurrentRow stops counting after accessing a device from a jump server

Hi Team,

I am trying to use the crt.Screen.CurrentRow but it seems only to work as long as I am on the jump server, once I ssh to another device the value returned always have the same row number. Is there anything that I am missing ?

Thanks,
Amr
Reply With Quote
  #2  
Old 06-01-2020, 10:48 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,397
Hi Amr_Wael,

I am sorry to hear of the issue. It's working as expected for me.

What version of SecureCRT are you using? On what OS/platform?

How are you connecting to the end host? Are you using dependent session? Or just connecting to the jump host and entering "ssh _end_host_"?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 06-01-2020, 09:58 PM
Amr_Wael Amr_Wael is offline
Registered User
 
Join Date: Jun 2020
Posts: 4
Hi Brenda,

I am using Version 8.5.1 on Windows platform. Yes, I am connecting to the jump host and then ssh to the end host

Thanks,
Amr
Reply With Quote
  #4  
Old 06-02-2020, 07:35 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,397
Hi Amr,

In all cases, I got an accurate value.

Please post the code that includes the crt.Screen.CurrentRow() call.

Please also post screenshots (unless sensitive data) illustrating the inaccurate value you are getting.

If the code or screenshots contain sensitive data, please send to support@vandyke.com and reference Attn Brenda - Forum Thread #14147.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 06-03-2020, 02:35 AM
Amr_Wael Amr_Wael is offline
Registered User
 
Join Date: Jun 2020
Posts: 4
Hi Brenda,

Please find the code below, for the snapshot I am not sure why I can't post attachments so I will be sending this via mail

Code:
tab = crt.Session.ConnectInTab('/ssh2 /L ' + username + ' /PASSWORD ' + password + ' IP.Address')

tab.Activate()
tab.Screen.Synchronous = True

tab.Caption = Device_name


tab.Screen.WaitForString("Nmstel password: ")
tab.Screen.Send(password + '\n')
tab.Screen.WaitForString("#")
tab.Screen.Send("ssh " + vedge_username + "@" + Device_name + '\n')
Row0 = tab.Screen.CurrentRow <<<<<<<<<<<<<<<< Last correctly counted Row
tab.Screen.Send('! current row is '+ str(Row0) +'\n')
tab.Screen.WaitForString("password: ", 30)
tab.Screen.Send(vedge_password + '\n')
tab.Screen.WaitForString("#", 30)
tab.Screen.Send('screen-length 0'+ '\n')
tab.Screen.WaitForString("#", 30)
tab.Screen.Send('screen-width 256'+ '\n')
tab.Screen.WaitForString("#", 30)

def main():

  tab.Session.Log(False)
  tab.Session.LogFileName = os.path.expanduser('~\\Desktop\\Vedge_ATP\\' + Device_name + "\\" + "case1" + ".txt")
  tab.Session.Log(True)
  tab.Screen.Send('show system status'+ '\n')
  tab.Screen.WaitForString("#", 30)
  tab.Screen.Send('show hardware alarms'+ '\n')
  tab.Screen.WaitForString("#", 30)
  tab.Screen.Send('show interface description'+ '\n')
  tab.Screen.WaitForString("#", 30)
  Row1 = tab.Screen.CurrentRow >>>>>> This row has a value of 58
  tab.Screen.Send('! current row is '+ str(Row1) +'\n')
  tab.Screen.Send('show interface ge0/1'+ '\n')             
  tab.Screen.WaitForString("#", 30)  
  Row2 = tab.Screen.CurrentRow >>>>>> This row as well has a value of 58
  tab.Screen.Send('! current row is '+ str(Row2) +'\n')
  DuplexRows =  Row2 - Row1
  tab.Screen.Send("!" + str(DuplexRows)+ '\n')
  tab.Screen.WaitForString("#", 30)
main ()
Reply With Quote
  #6  
Old 06-03-2020, 07:58 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,397
Hi Amr,

I replied to your email with an additional request for a raw log.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 06-09-2020, 09:26 AM
Amr_Wael Amr_Wael is offline
Registered User
 
Join Date: Jun 2020
Posts: 4
Hi Brenda,

Once the device is connected the raw log is immediately disabled and the tick jumps to the normal log instead.

I have replied back to your mail with more details and snapshots

Thanks,
Amr
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:11 AM.