;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright 2005 Routrek Networks,Inc. All rights reserved ; Cuscom Cisco LocalDirector definition ; Version 0.3 ; $RCSfile: TargetLDirector.txt,v $ ; $Revision: 1.1.2.1 $ $Date: 2005/03/14 05:47:46 $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RMC configuration example: ; ; copy terminal running-config (then paste this file.) ; set port comN ; set target-type ld ; set target-login-password ; set target-enable-password ; set target-check ; set network-info-time ; set connect-log ; set spy comN tfl0 ml0 ; ; Note: ; The following configuration is recommented on Cisco LocalDirector ; no pager ; The following configuration is necessary to enable console log: ; enable ; configure terminal ; syslog console ; syslog output 16.error ; exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set user-target-type ld ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-filter ld tfl0 # All severity (0-7) # $Revision: 1.1.2.1 $ $Date: 2005/03/14 05:47:46 $ /%[-a-zA-Z0-9_]+-[0-7]/ /<[0-7]+> / { # Insert timestamp system("echo -n \"`date +'%b %d %H:%M:%S'` \"") print } # Bad password /Invalid password/ ----END OF FILTER---- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set target-script ld login # Login script for Cisco LocalDirector. # $Revision: 1.1.2.1 $ $Date: 2005/03/14 05:47:46 $ # # r = retry count set r 3 # Send [enter] and wait password prompt. send "" waitprompt: expect { "assword:" break "# " exit 0 "> " exit 0 "<--- More --->" goto more timeout 10 goto error } # Send password password: send $(TARGET_LOGIN_PASSWORD) expect { "> " exit 0 "assword:" dec r "Invalid password" goto password_error timeout 10 goto error } # retry failed. password error if 0 = r goto password_error goto password password_error: exit 3 # quit <--- More ---> prompt more: send "q\c" goto waitprompt error: exit 1 ----END OF SCRIPT---- set target-script ld command call login timeout 300 # Command loop loop: # send a command one by one ! test "`sendcmd -t`" = "ping" if $? = 0 goto ping_cmd ! sendcmd if $? != 0 goto logout_disable gosub wait_prompt goto loop ping_cmd: ! sendcmd -p -n > /dev/null ! test $ARG1 if $? != 0 goto loop print "" print "---start command result---" print "---ping---" send "ping \c" send $(ARG1) gosub wait_prompt goto loop wait_prompt: expect { "> " break "# " break "Press RETURN" exit 0 "assword:" goto enable_password "Invalid password" goto password_error "<--- More --->" goto more "[yes/no]:" goto confirm "[confirm]" goto confirm timeout 120 goto error } # seems to be a prompt but check interval to confirm. wait_interval: expect { timeout 2 return } goto wait_interval # 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 "" goto wait_prompt logout_disable: verbose off #send "logout" send "disable" expect { "> " exit 0 "Press ENTER" exit 0 timeout 20 goto error } error: exit 1 password_error: exit 3 ----END OF SCRIPT---- set target-script ld target-check # target-check script for Cisco LocalDirector # set target-script ld target-check call login # no logout/disable necessary for console exit 0 ----END OF SCRIPT---- set target-script ld network-info # command # Network information command for Cisco LocalDirector (use command script) show version show hw enable # This command is necessary for RMS show config # This command is necessary for RMS write terminal show memory show blocks show failover show interface show conn show statistics # This command is necessary for RMS show route ----END OF SCRIPT----