华为DSLAM MA5600单个端口自动调速.doc_第1页
华为DSLAM MA5600单个端口自动调速.doc_第2页
华为DSLAM MA5600单个端口自动调速.doc_第3页
华为DSLAM MA5600单个端口自动调速.doc_第4页
华为DSLAM MA5600单个端口自动调速.doc_第5页
已阅读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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论