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 12-29-2017, 10:22 AM
hesseny2000's Avatar
hesseny2000 hesseny2000 is offline
Registered User
 
Join Date: Nov 2015
Location: Cairo
Posts: 2
Cool find and replacing the vlan id from the Huawei MSAN output

Hi,
I'm learning python and I tried to make a script that find and replacing the wrong Vlan id of the DSL cabinet automatically, but i can't get the vlan id from the output using the below code:


[CODE]
crt.Screen.Send("display current-configuration section vlan-config | include vlan attrib 4\n")
crt.Screen.WaitForString("\n vlan attrib ",5)
out1=crt.Screen.ReadString("stacking",5)
crt.Dialog.MessageBox(out1)#to check the output
VLan = out1[12:15]
crt.Dialog.MessageBox(VLan)#should find the correct vlan id


Another code

===========>
===========>
Code:
                crt.Screen.Send("display current-configuration section vlan-config | include vlan attrib 4\n")
                crt.Screen.WaitForString("\n vlan attrib ",5)
                nRow = crt.Screen.CurrentRow
                nCol = crt.Screen.CurrentColumn - 1
                hostname = crt.Screen.Get(nRow, 1, nRow, nCol)
                crt.Dialog.MessageBox(hostname)
Reply With Quote
  #2  
Old 12-29-2017, 10:31 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi hesseny2000,

I'm happy to help take a look at what we can do to get you the information you need.

Can you provide an example of the output you see after running the command:

Code:
  crt.Screen.Send("display current-configuration section vlan-config | include vlan attrib 4\n")
Without knowing what the output looks like it will be exceeding difficult for me to determine why you're not able to capture the needed data. Please also indicate exactly which part of the output you are wanting to capture.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-30-2017, 04:07 AM
hesseny2000's Avatar
hesseny2000 hesseny2000 is offline
Registered User
 
Join Date: Nov 2015
Location: Cairo
Posts: 2
find and replacing the vlan id from the Huawei MSAN output

check the below link of output :


**************** 1 ************
https://drive.google.com/file/d/1Tux...ew?usp=sharing


************ 2 ************
https://drive.google.com/file/d/1Up_...ew?usp=sharing

**********3 ***************

https://drive.google.com/file/d/1PY9...ew?usp=sharing
Reply With Quote
  #4  
Old 12-31-2017, 09:54 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi hesseny2000,

I still don't have the needed information. Generally in order to capture data from SecureCRT's screen we will need to know what data you want to capture, what appears on screen immediately prior to the data you want to capture, and a string of text immediately after your desired data to indicate when to stop capturing.

It would be very helpful if you could provide a log of you running the needed commands manually.

Can you take these steps and send me the resulting log file
for analysis?

- Launch SecureCRT and open SecureCRT's main "File"
menu and select the "Trace Options" menu item.

- Open the "File" menu again and choose "Log Session..."
--> Specify a path to your Desktop folder and a name
of the log file, such as SCRT_Log.txt. For example:
%APPDATA%\..\..\Desktop\SCRT_Log.txt

- Now attempt your connection again.

- When the connection fails, open SecureCRT's "File" menu
and look at the "Log Session" menu item. If it has a
check-mark next to it, click on it to turn off logging.

- Go to your Desktop folder and locate the SCRT_Log.txt
file. Please send the SCRT_Log.txt file to me as an
attachment to your reply. Please don't paste the
contents into the body of your message -- please attach
it!

PLEASE DO NOT PROVIDE THE LOGS IN THE FORUM, WE DO NOT WANT TO ACCIDENTALLY EXPOSE SENSATIVE INFORMATION.

Please attach the resulting log and send it to Support@VanDyke.com with "Attn Eric Forum Post 12958" in the subject line.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
dsl , huawei , msan , python , vlan


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 06:50 PM.