;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright 2002 Routrek Networks,Inc. All rights reserved ; ExtremeWare definition ; Version 0.2 ; $RCSfile: TargetExtreme.txt,v $ ; $Revision: 1.12 $ $Date: 2002/10/18 10:43:21 $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RMC configuration example: ; ; copy terminal running-config (then paste this file.) ; set port comN ; set target-type extreme ; set target-login-name ; set target-login-password ; set target-check ; set network-info-time ; set connect-log ; set spy comN tfl0 ml0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Note: ; To display Extreme log messages on the console, use the following ; command: ; config log display {} ; enable log display ; disable cli-config-logging ; disable clipaging ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set user-target-type extreme ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-filter extreme tfl0 # All severity (CRIT, WARN, INFO, DBUG) # $Revision: 1.12 $ $Date: 2002/10/18 10:43:21 $ /^\r*$/ { # end of logs in show tech-support logtype = "" next } logtype == "show-tech" { next } /log entries:/ { # logs in show tech-support logtype = "show-tech" next } /<[A-Z ]+:[A-Z ]+>/ { # Do not send login/logout message if(($0 ~ /logged in through console/) || ($0 ~ /logged out from console/)){ next } # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # CRIT messages /(No cluster mbufs|failed in diagnostic|ipmcDelCache problem|panic: net|otpRamBusyWait|SYST: FAILED2|PBUS CRC Error)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # WARN messages /(Didn\'t get an ack|ecoder timeout|eraseFlashBlock failed|System is overheated)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # INFO messages /(Invalid cost for port|Invalid link speed|Invalid port speed|msgQSend error|is removed|updateEdpFilter|fetchPacket64 failed|messages from interrupt level lost)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } ----END OF FILTER---- ; set target-filter extreme tfl1 # High severity (CRIT) : emergency, alert, critical /^\r*$/ { # end of logs in show tech-support logtype = "" next } logtype == "show-tech" { next } /log entries:/ { # logs in show tech-support logtype = "show-tech" next } // { # Do not send login/logout message if(($0 ~ /logged in through console/) || ($0 ~ /logged out from console/)){ next } # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # CRIT messages /(No cluster mbufs|failed in diagnostic|ipmcDelCache problem|panic: net|otpRamBusyWait|SYST: FAILED2|PBUS CRC Error)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } ----END OF FILTER---- ; set target-filter extreme tfl2 # Middle severity (WARN) : error, warning, notice /^\r*$/ { # end of logs in show tech-support logtype = "" next } logtype == "show-tech" { next } /log entries:/ { # logs in show tech-support logtype = "show-tech" next } // { # Do not send login/logout message if(($0 ~ /logged in through console/) || ($0 ~ /logged out from console/)){ next } # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # WARN messages /(Didn\'t get an ack|ecoder timeout|eraseFlashBlock failed|System is overheated)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } ----END OF FILTER---- ; set target-filter extreme tfl3 # Low severity (INFO, DBUG) : information, debugging /^\r*$/ { # end of logs in show tech-support logtype = "" next } logtype == "show-tech" { next } /log entries:/ { # logs in show tech-support logtype = "show-tech" next } /<(INFO|DBUG):[A-Z ]+>/ { # Do not send login/logout message if(($0 ~ /logged in through console/) || ($0 ~ /logged out from console/)){ next } # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } # INFO messages /(Invalid cost for port|Invalid link speed|Invalid port speed|msgQSend error|is removed|updateEdpFilter|fetchPacket64 failed|messages from interrupt level lost)/ { # Cut login/command prompt gsub(/^\r*login: /, "") gsub(/^.+ [#>] /, "") print next } ----END OF FILTER---- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-script extreme login # Login script for ExtremeWare # $Revision: 1.12 $ $Date: 2002/10/18 10:43:21 $ # # Send [enter] and wait password prompt. send "" wait_prompt: expect { " > " goto logout " # " goto logout "login:" goto login " to quit:" goto more timeout 10 goto error } # Send login name login: ! test "$TARGET_LOGIN_NAME" if $? = 0 send $(TARGET_LOGIN_NAME) if $? != 0 send "admin" expect { " > " exit 0 " # " exit 0 "assword:" goto password timeout 10 goto error } # Send password password: send $(TARGET_LOGIN_PASSWORD) expect { " > " exit 0 " # " exit 0 "Login failed" goto password_error timeout 10 goto error } password_error: exit 3 # logout once to reset history # of command prompt logout: # changes? (y/n) : config save confirmation while logout send "logout" logout_loop: expect { "login:" goto login "changes? (y/n)" send "n" timeout 20 goto error } goto logout_loop # quit more prompt more: send "q\c" goto wait_prompt error: exit 1 ----END OF SCRIPT---- set target-script extreme command # command script for ExtremeWare verbose off call login timeout 600 # Hit Enter to skip " admin logged in ..." message send "" verbose on gosub wait_prompt # Command loop loop: set r 1 # send a command one by one ! sendcmd if $? != 0 goto logout gosub wait_prompt goto loop wait_prompt: # yes/no : run diag # (y/n)? : reboot # changes? (y/n) : config save confirmation while logout # changes (yes, no, or cancel) : config save confirmation when reboot # login : To handle system restart command expect { " > " break " # " goto wait_prompt " # " break " to quit:" goto more "yes/no " goto confirm "changes? (y/n)" goto noconfirm "changes (yes, no, or cancel)" goto noconfirm "(y/n)? " goto confirm "login: " exit 0 timeout 60 goto chk_response } # seems to be a prompt but check interval to confirm. wait_interval: expect { timeout 2 return } goto wait_interval chk_response: expect { timeout 10 goto no_response } set r 1 goto wait_prompt no_response: if r = 0 goto error dec r send "" goto wait_prompt # send space to more prompt more: send " \c" goto wait_prompt # send "yes" to confirm or yes/no prompt confirm: send "y" goto wait_prompt # send "no" to "Do you wish to save your configuration changes? (y/n)" noconfirm: send "n" goto wait_prompt logout: verbose off # changes? (y/n) : config save confirmation while logout send "logout" logout_loop: expect { "login:" exit 0 "changes? (y/n)" send "n" timeout 20 goto error } goto logout_loop error: exit 1 ----END OF SCRIPT---- set target-script extreme target-check # target-check script for ExtremeWare # set target-script extreme target-check send "" expect { " > " exit 0 " # " exit 0 "login:" exit 0 " to quit:" exit 0 timeout 20 exit 1 } ----END OF SCRIPT---- set target-script extreme network-info # command ('command' script is necessary) # Network information command for ExtremeWare # Version info: show version # Switch info: show switch # Switch management show management # Switch configuration info: # This command is necessary for RMS # show configuration detail show configuration # Odometer info: show odometers # Switch diagnostics inforamation: show diagnostics # Switch slot lot information (BlackDiamond) show slot # Switch forwarding database info: show fdb # Switch IP ARP database: show iparp # Switch IP forwarding database: show ipfdb # Switch IPMC forwarding database: show ipmc fdb # Switch IP statistics: show ipstats # Switch IP configuration: show ipconfig # Switch IP route database: # This command is necessary for RMS show iproute # Switch IPMC forwarding database: show ipmc fdb # Switch IPMC cache: show ipmc cache # Switch IGMP snooping: # show igmp snooping detail show igmp snooping # Switch internal memory: # show memory detail show memory # Switch port information: show ports info # Switch VLAN information: show vlan show vlan detail #### Option commands #### # Extreme Discovery Protocol # show edp # Switch ports detailed information # show ports info detail ----END OF SCRIPT----