已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
华为DSLAM MA5600单个端口自动调速原理和实现=程序语言:vbscript 运行工具:secureCRT 6.7 + 环境:windows 作者:鲍继川邮箱:时间:209.14=原理:1.通过CRM查找用户宽带的端口,如svlan,cvlan。2.通过读ma5600的文件(有telnet ip,用户名,密码;是一个列表),找到svlan的telent ip,后执行telnet 5600 进去。3.通过MA5600 的display current-configuration section abs-config | include cvlan 找到 cvlan ;例如 display current-configuration section abs-config | include 109 It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break at any time stacking label 0/0/9 vpi 0 vci 35 109就可以找到board和实际物理宽带端口了,如上面 0/0/94. 寻找要用的宽带模板 用以下命令 如display current-configuration section global-config | include 6656 ,没有则创建模板。用命令 adsl line-profile add 添加,详细见代码。5 进入步骤3找到的板卡 #interface adsl 0/0 。然后deactivate 9,然后 acvate 9 profile-index 9 。激活所需端口和宽带模板后,save,退出就完成。=程序执行效果图:脚本实际运行如下: Huawei MA5600 Multi-service Access Module. Copyright(C)Huawei Technologies Co.,Ltd. 2002-2007. All rights reserved.User name:rootUser password:xxx.xxx.xxx_5600enablexxx.xxx.xxx_5600#configxxx.xxx.xxx_5600(config)#display current-configuration section abs-config | include 109 It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break at any time stacking label 0/0/9 vpi 0 vci 35 109xxx.xxx.xxx_5600(config)#display current-configuration section global-config | include 6656 It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break at any time adsl line-profile quickadd 9 basic-para all trellis 1 bitswap 0 0 channelinterleaved 6 6 adapt at-startup snr 6 0 31 6 0 31 rate 32 6656 32 640 name ADSL LINE PROFILE 9 adsl line-profile quickadd 13 basic-para all trellis 1 bitswap 1 1 channelinterleaved 16 6 adapt at-startup snr 6 0 31 6 0 31 rate 32 6656 32 512 nameADSL LINE PROFILE 13 adsl line-profile quickadd 14 basic-para all trellis 1 bitswap 1 1 channelinterleaved 16 6 adapt at-startup snr 6 0 31 6 0 31 rate 32 6656 32 512 nameADSL LINE PROFILE 14xxx.xxx.xxx_5600(config)#interface adsl! EVENT WARNING 2012-09-21 19:14:50 ALARM NAME :ADSL port reactivation after line recovery PARAMETERS :Frame ID: 0, Slot ID:11, Port ID:20xxx.xxx.xxx_5600(config)#interface adsl 0/0xxx.xxx.xxx_5600(config-if-adsl-0/0)#deactivate 9xxx.xxx.xxx_5600(config-if-adsl-0/0)#ac Deactivate port 9 successfullyxxx.xxx.xxx_5600(config-if-adsl-0/0)#act! EVENT WARNING 2012-09-21 19:14:51 ALARM NAME :ADSL port deactivation PARAMETERS :Frame ID: 0, Slot ID: 0, Port ID: 9ixxx.xxx.xxx_5600(config-if-adsl-0/0)#acvate 9 profile-index 9xxx.xxx.xxx_5600(config-if-adsl-0/0)#qui Send the command to activate port 9 successfullyxxx.xxx.xxx_5600(config-if-adsl-0/0)#quitxxx.xxx.xxx_5600(config)#quitxxx.xxx.xxx_5600#save |configuration : Command: save Now the system is checking whether data has changed, please wait a moment.xxx.xxx.xxx_5600#=5600文件为 5600ip.txt 用来读取每个5600的ip和svlan的。xxx.xxx.xxx.104 202xxx.xxx.xxx.105 200xxx.xxx.xxx.106 201xxx.xxx.xxx.113 209xxx.xxx.xxx.116 212xxx.xxx.xxx.122 218内容完;第一个值为ip,第二个为svlan通过比较输入的svlan和5600文件的svlan,匹配则telnet进去。执行下面的代码。完整代码:5600单个修改速率.vbs#$language = VBScript#$interface = 1.0 This automatically generated script may need to be edited in order to work correctly.Sub Main Const ForReading = 1, ForWriting = 2, ForAppending = 8dim svlansvlan= crt.Dialog.Prompt(输入svlan主端口, 输入端口一个值, 113, false) svlan=Trim(svlan)if(svlan=) thencrt.Dialog.MessageBox 端口为空!exit subend ifdim cvlancvlan= crt.Dialog.Prompt(输入cvlan, 输入端口第二个值, 109, false) cvlan=Trim(cvlan)if(cvlan=) thencrt.Dialog.MessageBox 端口为空!exit subend ifdim bandband= crt.Dialog.Prompt(输入宽带(M), 输入, 6.5, false) band=Trim(band)if(band=) thencrt.Dialog.MessageBox 宽带为空!exit subend ifSet fso1 = CreateObject(Scripting.FileSystemObject)Set fso2 = CreateObject(Scripting.FileSystemObject) if Not fso1.FileExists(E:Easy5600ip.txt) then crt.Dialog.MessageBox 5600不存在 & vbcrlf & _ vbcrlf & _ swname & vbcrlf & vbcrlf & _ 请重新运行脚本! exit subend ifSet file1= fso1.OpenTextFile(E:Easy5600ip.txt,1, False) DO While file1.AtEndOfStream Trueline1 = Trim(file1.ReadLine)if (line1=) thenexit subend ifmsgbox(line1)params=Split(line1)msgbox(params(0)msgbox(params(1)s=Trim(params(1)匹配5600文件里svlan和第一个端口的值,相等则telnet进去if(s=svlan)thenip=params(0)Dim objTabSet objTab = crt.GetScriptTabobjTab.Screen.Synchronous = TrueobjTab.session.LogFileName = e:Easylog & Date() & & ip & .txt objTab.session.Log(true)objTab.Session.Connect /telnet & ip if objTab.Session.Connected=false thenexit sub end ifobjTab.Screen.WaitForString User name:objTab.Screen.Send root & vbcrobjTab.Screen.WaitForString User password:objTab.Screen.Send dslam2011 & vbcrobjTab.Screen.WaitForString objTab.Screen.Send en & vbcrobjTab.Screen.WaitForString #objTab.Screen.Send conf & vbcrobjTab.Screen.WaitForString (config)#objTab.Screen.Send display current-configuration section abs-config | include &cvlan&vbcr取得vci前面的板卡信息,如0/0/9objTab.Screen.WaitForString ,2t=objTab.Screen.ReadString(vci)msgbox(t)op1=Instr(t,label)op2=InStr(t,vpi)y=Mid(t,op1,op2-op1+2)u=Split(y, )a=Split(u(1),/)自动找调速模板objTab.Screen.Send display current-configuration section global-config | include &band*1024&vbcrobjTab.Screen.WaitForString ,1z=objTab.Screen.ReadString(name)op8=InStr(20,z,band*1024)msgbox(op8)msgbox(z)没有则创建模板if op8=0 thenobjTab.Screen.Send adsl line-profile add &vbcrobjTab.Screen.WaitForString :objTab.Screen.Send vbcrobjTab.Screen.WaitForString n:objTab.Screen.Send vbcrobjTab.Screen.WaitForString 0:objTab.Screen.Send 1 & vbcrobjTab.Screen.WaitForString n:objTab.Screen.Send vbcrobjTab.Screen.WaitForString 0:objTab.Screen.Send vbcrobjTab.Screen.WaitForString n:objTab.Screen.Send vbcrobjTab.Screen.WaitForString 1:objTab.Screen.Send vbcrobjTab.Screen.WaitForString n:objTab.Screen.Send vbcrobjTab.Screen.WaitForString n:objTab.Screen.Send y & vbcrobjTab.Screen.WaitForString 32:objTab.Screen.Send 3 & chr(8) & vbcrobjTab.Screen.WaitForString 24544:objTab.Screen.Send band*1024 & vbcrobjTab.Screen.WaitForString 32:objTab.Screen.Send vbcrobjTab.Screen.WaitForString 1024:objTab.Screen.Send 512 & vbcrobjTab.Screen.WaitForString (config)#objTab.Screen.Send display current-configuration section global-config | include &band*1024&vbcrobjTab.Screen.WaitForString ,2z=objTab.Screen.ReadString(name)end if取得模板的值op3=Instr(z,quick)op4=InStr(z,basic)x=Mid(z,op3,op4-op3+5)msgbox(x)c=Split(x)msgbox(c(1)objTab.Screen.WaitForS
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2027届高三数学一轮复习课件:第九章 9.2 二项式定理
- 2026年及未来5年市场数据中国少儿艺术培训教育行业市场全景评估及投资方向研究报告
- 2026年及未来5年市场数据中国液晶聚合物(LCP)行业市场深度分析及投资策略研究报告
- 2026江苏无锡市新吴区江溪幼儿园后勤人员招聘1人考试参考题库及答案解析
- 膜剂工岗前风险识别考核试卷含答案
- 2026西藏林芝工布江达县人民检察院司法警务辅助人员招聘2人笔试备考题库及答案解析
- 工业危险废物处理工岗前理论技能考核试卷含答案
- 自然保护区巡护监测员QC管理水平考核试卷含答案
- 三聚氰胺装置操作工风险评估知识考核试卷含答案
- 2026年及未来5年市场数据中国董青石轻质耐火砖行业市场深度分析及投资策略研究报告
- 《民用航空危险品运输管理规定》考试题库150题(含答案)
- 铝方通吊顶施工技术措施方案
- DB63-T 1143-2012 青海省受损砌体结构安全性鉴定实施导则
- 运动损伤的预防、治疗与恢复
- 2024-2025学年浙江省杭州市西湖区十三中教育集团八年级下学期期中检测道德与法治试卷
- 机械设备维修成本控制措施
- 《贵州省普通国省干线公路养护科学决策指南》
- 《广东省既有建(构)筑物加固 改造工程成本取费导则》
- DG-TJ08-401-2025 公共厕所规划和设计标准
- 卫健委课题申报书模板
- 2025年湖南省普通高中学业水平合格性考试数学试卷(含答案)
评论
0/150
提交评论