::cisco::eem::event_register_none # # This EEM tcl policy was generated by the EEM applet conversion # utility at http://www.marcuscom.com/convert_applet/ # using the following applet: # # event manager applet ssh_test # # event none # # action 0.5 cli command "enable" # # action 1.0 cli command "ssh -l username xxxxxx" pattern "assword:" # # action 2.0 cli command "password" pattern "#" # # action 2.5 cli command "term len 0" pattern "#" # # action 2.6 cli command "term width 0" pattern "#" # # action 3.0 cli command "show int status" pattern "#" # # action 4.0 puts "$_cli_result" # # action 5.0 cli command "exit" # namespace import ::cisco::eem::* namespace import ::cisco::lib::* array set arr_einfo [event_reqinfo] if [catch {cli_open} result] { error $result $errorInfo } else { array set cli1 $result } if [catch {cli_exec $cli1(fd) "enable"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "ssh -l username xxxx"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "assword:"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "password"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "#"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "term len 0"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "#"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "term width 0"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "#"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_write $cli1(fd) "show int status"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_read_pattern $cli1(fd) "#"} _cli_result] { error $_cli_result $errorInfo } puts "$_cli_result" if [catch {cli_exec $cli1(fd) "exit"} _cli_result] { error $_cli_result $errorInfo } # Close open cli before exit. catch {cli_close $cli1(fd) $cli1(tty_id)} result