当前位置:网站首页>Use the securecrtportable script function to read data from network devices
Use the securecrtportable script function to read data from network devices
2022-06-11 22:09:00 【dawn】
Always use SecureCRTPortable To maintain network devices .
There are too many network commands , I find the work tedious and boring , One of the daily tasks is to frequently read the data records of network devices from network devices , Previously used Python Script to complete , It's very convenient , It is not used again Python, To use now, you must install Python, Don't want to toss .
Come across SecureCRTPortable With script recording function , Check on the Internet , It can execute scripts , Include VBScript、JavaScript and Python, It's so good !
I checked the relevant information this afternoon , utilize VBScript Completed the previous use Python Finished function .
The script is as follows :
#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
crt. Window.show 0
'crt.Window.State 0
Sub Main
dim NetEquipmentName
dim NetEquipmentIP
dim UserName
dim UserPwd
dim LogFileName
dim LogPath
' Set parameters
NetEquipmentName=" Network device name "
NetEquipmentIP="IP Address "
UserName=" user name "
Userpwd=" password "
LogPath=" File path "
LogFileName=LogPath & NetEquipmentName & Year(Now) & Month(Now) & Day(Now) & "-" & Hour(Now) & Minute(Now) & ".txt"
' Access network devices
crt.session.Connect("/telnet " & NetEquipmentIP )
'crt.Window.Activate
'crt. Window.show 0
'crt.Window.State=0
crt.Screen.WaitForString("ogin:")
crt.Screen.Send(UserName & chr(13))
crt.Screen.WaitForString("assword:")
crt.Screen.Send(UserPwd & chr(13))
crt.Screen.WaitForString("<xxs01>")
crt.Session.LogFileName=LogFileName
crt.Session.Log True
crt.Screen.Send " command " & chr(13)
Do while crt.Screen.WaitForString("---- More ----",1,true)=True
crt.Sleep(500)
crt.Screen.Send " " & chr(13)
Loop
crt.Screen.Send "quit" & chr(13)
crt.Session.Disconnect()
' Exit procedure
crt.Screen.Synchronous = False
crt.quit()
End Sub
Write a bat file , There's only one line :
File path \SecureCRT.exe /SCRIPT DailyNetworkDataCollection.vbsstay windows Add this to your plan list bat File can be installed for a fixed time .
This function is really practical ! A lot of work has been reduced !
边栏推荐
- 使用VBScript读取网络的日志数据进行处理
- inner join执行计划变了
- 移动端——swipe特效之图片时间轴
- Popular science | what are the types of NFT (Part 1)
- Implementation stack and queue
- C language implements eight sorts (1)
- Three methods of quick sorting
- 图的基本操作(C语言)
- [Yu Yue education] General English of Shenyang Institute of Engineering (4) reference materials
- C语言实现八种排序(1)
猜你喜欢

实现栈和队列

Explain asynchronous tasks in detail: the task of function calculation triggers de duplication

Implementation stack and queue

206. reverse linked list

Introduction to MySQL transactions

The device is in use when win10 ejects USB

科普 | NFT的类型有哪些(上)

R语言书籍学习03 《深入浅出R语言数据分析》-第八章 逻辑回归模型 第九章 聚类模型

Classes and objects (3)

玩家必读|Starfish NFT进阶攻略
随机推荐
A simple example of linear regression in machine learning
Addition without addition, subtraction, multiplication, Division
Optimization of quick sort
Tkinter学习笔记(二)
【数据挖掘时间序列分析】餐厅销量预测
238.除自身以外数组的乘积
67. 二进制求和
《物联网开发实战》18 场景联动:智能电灯如何感知光线?(上)(学习笔记)
The shortcomings of the "big model" and the strengths of the "knowledge map"
超標量處理器設計 姚永斌 第2章 Cache --2.4 小節摘錄
Introduction to MySQL transactions
3.3 测试模块的命名规则
如果重来一次高考,我要好好学数学!
win10字体模糊怎么调节
机器学习之线性回归简单实例
BUUCTF(5)
Nmap进行主机探测出现网段IP全部存活情况分析
不使用加减乘除做加法
Non recursive writing of quick sort
自定义实现offsetof