;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright 2002 Routrek Networks,Inc. All rights reserved ; Cuscom Foundry Router/Switch definition ; Version 0.2 ; $RCSfile: TargetFoundry.txt,v $ ; $Revision: 1.4 $ $Date: 2002/10/16 09:20:17 $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RMC configuration example: ; ; copy terminal running-config (then paste this file.) ; set port comN ; set target-type foundry ; set target-enable-password ; set target-check ; set network-info-time ; set connect-log ; set spy comN tfl0 ml0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Note: ; To display Foundry log messages on the console, use the following ; command: ; enable ; logging on ; no logging buffered debugging ; no logging enable user-login ; no logging enable config-changed ; logging console ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set user-target-type foundry ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-filter foundry tfl0 # All severity # $Revision: 1.4 $ $Date: 2002/10/16 09:20:17 $ /^\r*SYSLOG/ { system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } ----END OF FILTER---- ; set target-filter foundry tfl1 # High severity (0-2) : emergency, alert(<9>), critical /^\r*SYSLOG <[0-9]>/ { system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } /^\r*SYSLOG <10>/ { system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } ----END OF FILTER---- ; set target-filter foundry tfl2 # Middle severity (3-5) : error, warning(<12>), notification /^\r*SYSLOG <1[1-3]>/ { system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } ----END OF FILTER---- ; set target-filter foundry tfl3 # Low severity (6-7) : information(<14>), debugging /^\r*SYSLOG <1[4-9]>/ { system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } ----END OF FILTER---- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-script foundry login # Login script for Foundry. # $Revision: 1.4 $ $Date: 2002/10/16 09:20:17 $ # # Send [enter] and wait prompt. send "" wait_prompt: expect { "->" goto wait_prompt ">" goto enable "#" exit 0 "quit: Control-c" goto more "(enter 'y' or 'n'): " goto confirm timeout 10 goto error } enable: send "enable" expect { "assword:" goto enable_password timeout 10 goto error } # enable password prompt enable_password: send $(TARGET_ENABLE_PASSWORD) expect { "incorrect password." goto password_error "#" exit 0 timeout 10 goto error } # quit --More-- prompt more: send "\003\c" goto wait_prompt # send enter to confirm or yes/no prompt confirm: send "y" goto wait_prompt error: exit 1 password_error: exit 3 ----END OF SCRIPT---- set target-script foundry command verbose off call login timeout 600 verbose on # Command loop loop: set r 1 # send a command one by one ! sendcmd if $? != 0 goto quit gosub wait_prompt goto loop wait_prompt: # "->" : to handle "Invalid input ->" # "quit: Control-c" : to handle "--More-- ..." expect { "->" goto wait_prompt ">" break "#" break "assword:" goto enable_password "incorrect password." goto password_error "quit: Control-c" goto more "(enter 'y' or 'n'): " goto confirm 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 # enable password prompt enable_password: send $(TARGET_ENABLE_PASSWORD) goto wait_prompt # send space to "--More-- ..." prompt more: send " \c" goto wait_prompt # send enter to confirm or yes/no prompt confirm: send "y" goto wait_prompt quit: verbose off send "quit" expect { ">" exit 0 timeout 10 goto error } error: exit 1 password_error: exit 3 ----END OF SCRIPT---- set target-script foundry target-check # target-check script for Foundry # set target-script foundry target-check # Send [enter] and wait password prompt. send "" wait_prompt: expect { "->" goto wait_prompt ">" exit 0 "#" exit 0 "quit: Control-c" goto more "(enter 'y' or 'n'): " goto confirm timeout 10 goto error } # quit --More-- prompt more: send "\003\c" goto wait_prompt # send enter to confirm or yes/no prompt confirm: send "y" goto wait_prompt error: exit 1 ----END OF SCRIPT---- set target-script foundry network-info # command # Network information command for Foundry (use command script) # Note: "enable" is not necessary (always enabled automatically) show version # This command is necessary for RMS show configuration # This command is necessary for RMS write terminal show interface # If router, this command is necessary for RMS show ip route show ip traffic ----END OF SCRIPT----