How do i add additional keystokes for a specific device to exit a menu to get the enable prompt? All i need to do is add an "x" for exit to the menu and it will drop immediately to a enable prompt. Then the config backup process can run like any other router.
The device is a Cisco 2811 being used as a console terminal router. It has a menu when the user first connects. It is running IOS 15.1(4)M12a
Code: Select all
HEADER:
Address: 10.X.X.16
Zone number: 0
Job type: DISCOVERY
Job started: 2021-10-25 18:31:34.211
Job finished: 2021-10-25 18:31:41.689
DEVICE OUTPUT START:
<<SSH connect - socket>>SSH-2.0-Cisco-1.25
<<SSH disconnect - socket>><<SSH connect - session>>
TIMESTAMP: 2021-10-25 18:31:35.530
<<SSH connect - shell channel>>
**********************************************************
Welcome to the XXXXXX Console Server
To exit from a device, use CTRL+SHIFT+6 then press x
**********************************************************
0 Console to: XXXXXX
1 Console to: XXXXXX
2 Console to: XXXXXX
3 Console to: XXXXXX
4 Console to: XXXXXX
5 Console to: XXXXXX
6 Console to: XXXXXX
7 Console to: XXXXXX
# -------------------------------------------
25 Console to: TEST port 8, HWIC1
$ -------------------------------------------
s show all established sessions
c<#> clear the session by number ie: c12
x Exit Menu
q Quit SSH session
Your selection :
TIMESTAMP: 2021-10-25 18:31:37.752
<<SSH disconnect - channel & session>><<SSH connect - session>>
TIMESTAMP: 2021-10-25 18:31:39.051
<<SSH connect - shell channel>>
**********************************************************
Welcome to the XXXXXX Console Server
To exit from a device, use CTRL+SHIFT+6 then press x
**********************************************************
0 Console to: XXXXXX
1 Console to: XXXXXX
2 Console to: XXXXXX
3 Console to: XXXXXX
4 Console to: XXXXXX
5 Console to: XXXXXX
6 Console to: XXXXXX
7 Console to: XXXXXX
# -------------------------------------------
25 Console to: TEST port 8, HWIC1
$ -------------------------------------------
s show all established sessions
c<#> clear the session by number ie: c12
x Exit Menu
q Quit SSH session
Your selection :
TIMESTAMP: 2021-10-25 18:31:41.580
Your selection : get mode
Your selection : <<SSH disconnect - channel & session>>
DEVICE OUTPUT END:
This is what is in the logs with DEBUG enabled. There are numerous lines after these that show Unimus trying to determine what type of device and then it eventually quits as it cannot determine the make/model and it sends an email.
Code: Select all
2021-10-25 18:31:34.220 TRACE 5204 --- [discovery-64] n.u.c.s.connection.ssh.SshConnection : Creating SSH session to '10.X.X.16':'22' with 'Credential{id=2, username='XXXXXX', password = 7 character(s)}', connectTimeout '10000'ms
2021-10-25 18:31:35.530 DEBUG 5204 --- [discovery-64] n.u.core.cli.login.CliLoginStateMachine : CLI login process for '10.X.X.16:22' starting in CONNECTED state
2021-10-25 18:31:36.642 DEBUG 5204 --- [discovery-64] n.u.core.cli.login.CliLoginStateMachine : CLI login process for '10.X.X.16:22' moving to BANNER_DETECTED state
2021-10-25 18:31:37.752 TRACE 5204 --- [discovery-64] n.u.c.c.login.data.CliLoginDataAnalyzer : 'PROMPT_DETECTED' state detected on '10.X.X.16:22', validating input before accepting state
2021-10-25 18:31:37.752 DEBUG 5204 --- [discovery-64] n.u.core.cli.login.CliLoginStateMachine : CLI login process for '10.X.X.16:22' moving to PROMPT_DETECTED state
2021-10-25 18:31:37.752 DEBUG 5204 --- [discovery-64] n.u.core.cli.login.CliLoginStateMachine : CLI login process for '10.X.X.16:22' moving to AUTHENTICATED state
2021-10-25 18:31:37.752 TRACE 5204 --- [discovery-64] n.u.c.s.connection.ssh.SshConnection : Closing device CLI session
2021-10-25 18:31:37.752 TRACE 5204 --- [discovery-64] n.u.c.s.connection.ssh.SshConnection : Closing SSH shell channel
2021-10-25 18:31:37.752 TRACE 5204 --- [discovery-64] n.u.c.s.connection.ssh.SshConnection : Closing SSH session