;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright 2003 Routrek Networks,Inc. All rights reserved ; NEC IP8800 L3 switch series definition ; Version 0.1 ; $RCSfile: TargetIP8800.txt,v $ ; $Revision: 1.1 $ $Date: 2003/02/07 07:54:18 $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RMC configuration example: ; ; copy terminal running-config (then paste this file.) ; set port comN ; set flowcontrol software ; set tartget-type ip8800 ; set target-login-name ("root" if not set) ; set target-login-password ; set target-check ; set network-info-time ; set connect-log ; set spy comN tfl0 ml0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Note: ; ; To enable IP8800 message to console, see the following example: ; ; enable ; configure terminal ; logging console notifications ;กก logging console warnings shell ; logging cnslout ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set user-target-type ip8800 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-filter ip8800 tfl0 # syslog filter for IP8800 # $Revision: 1.1 $ $Date: 2003/02/07 07:54:18 $ logtype == "" && /show logging/ { # logs in show logging/tech-support logtype = "show-logging" next } logtype == "show-logging" { if($0 ~ /^\r*[^ ]+[#>]/) { # end of logs in show logging logtype = "" } else if($0 ~ /^\r*---------------------/) { # end of logs in show tech-support logtype = "" } next } /[A-Z][a-z][a-z] +[0-9]+ [0-9:]+ [A-Z]+ *:/ { # Cut login/logout message from console if($0 ~ /NOTE:login:(LOGIN:|LOGOUT:).* console/){ next } else if($0 ~ /NOTE:login:CMDMODE:EXEC\/User Level to EXEC\/Privileged Level/){ next } # Cut login prompt gsub(/^\r*login:/, "") print } ----END OF FILTER---- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-script ip8800 login # Login script for IP8800. # $Revision: 1.1 $ $Date: 2003/02/07 07:54:18 $ # # Send [enter] and wait prompt. send "" wait_prompt: expect { "login:" goto login ">" goto enable "#" exit 0 "-- More --" goto more timeout 10 break } # Send login name login: ! test "$TARGET_LOGIN_NAME" if $? = 0 send $(TARGET_LOGIN_NAME) if $? != 0 send "root" expect { "Password:" goto password timeout 10 goto error } # Send password password: send $(TARGET_LOGIN_PASSWORD) expect { ">" break "login failure." goto password_error timeout 10 goto error } enable: send "enable" expect { "Password:" goto enable_password timeout 10 goto error } # enable password prompt enable_password: send $(TARGET_ENABLE_PASSWORD) expect { "Bad password." goto password_error "#" exit 0 timeout 10 goto error } # quit --More-- prompt more: send "q\c" goto wait_prompt error: exit 1 password_error: exit 3 ----END OF SCRIPT---- set target-script ip8800 command # Command script for IP8800. # $Revision: 1.1 $ $Date: 2003/02/07 07:54:18 $ # verbose off call login # disable more send "no more-enable" gosub wait_prompt # "show tech-support" takes looooong time timeout 1200 verbose on # Command loop loop: set r 1 # reload command ? ! test "`sendcmd -t`" = "reload" if $? = 0 goto reload # send a command one by one ! sendcmd if $? != 0 goto quit gosub wait_prompt goto loop wait_prompt: expect { ">" break "#" break "Password:" goto enable_password "Bad password." goto password_error "-- More --" goto more timeout 10 goto chk_response } # seems to be a prompt but check interval to confirm. wait_interval: expect { timeout 1 return } goto wait_prompt 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 # enable password prompt enable_password: send $(TARGET_ENABLE_PASSWORD) goto wait_prompt # send space to "-- More --" prompt more: send " \c" goto wait_prompt quit: verbose off send "logout" expect { "login:" exit 0 timeout 10 goto error } reload: ! sendcmd expect { "login:" exit 0 timeout 180 goto error } error: exit 1 password_error: exit 3 ----END OF SCRIPT---- set target-script ip8800 target-check # target-check script for IP8800 # set target-script ip8800 target-check # Send [enter] and wait prompt. send "" wait_prompt: expect { "login:" exit 0 ">" exit 0 "#" exit 0 "-- More --" exit 0 timeout 10 goto error } error: exit 1 ----END OF SCRIPT---- set target-script ip8800 network-info # command # Network information command for IP8800 (use command script) # $Revision: 1.1 $ $Date: 2003/02/07 07:54:18 $ # Note: "enable" is not necessary (always enabled automatically) show version # This command is necessary for RMS show environment # This command is necessary for RMS show startup-config # This command is necessary for RMS show running-config # This command is necessary for RMS show gated-config # This command is necessary for RMS show ip router config # This command is necessary for RMS show ip route show ip statistics show memory show interface ethernet show interface ethernet summary show interface lag show processes show slot show faultmanager stat ----END OF SCRIPT----