[Solved] Cisco Router with Menu Prompt

Unimus support forum
Post Reply
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Tue Oct 26, 2021 12:46 am

I have searched and cant seem to find the answer.

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
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Tue Oct 26, 2021 12:47 am

Also, i'm using Unimus 2.1.0 on Windows 2019. Just downloaded for the first time and installed.
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Tue Oct 26, 2021 1:02 am

Hi, we need to add handling for this particular menu to our CLI login handler on our end. Thank you for providing the logs - this should be quite easy based on those.

I have created an internal ticket for this and one of our devs will make it happen. Will update this thread as soon as this is ready.
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Tue Oct 26, 2021 2:14 am

Thank you for the super quick response.

It would be nice to have a generic string that could be entered after login. This time it's an "X". Other times it could be "exit", "quit", "q", etc. Not sure how easy that would be to implement.

Thank you again!
Vik@Unimus
Posts: 198
Joined: Thu Aug 05, 2021 6:35 pm

Fri Dec 17, 2021 10:02 pm

Hello Everyone,

I would like to reiterate on Tomas' previous message. Unimus version 2.2.0-Beta1 is live and brings a support for this particular type of the menu prompt. You can download a new version from the link below

https://unimus.net/download-dev.html

If you get a chance, give it a try and let us know if you experience any problem with it, whether directly, here, via a support ticket or into our thread dedicated to this Beta release here

viewtopic.php?f=4&t=1395
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Fri Dec 17, 2021 10:24 pm

Thank you!

Where do i add that config to the device? I just upgraded to 2.2.0.Beta1 but i'm not sure where to set that extra config to have it auto type "x" upon connection.
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Fri Dec 17, 2021 10:26 pm

Nevermind! I see it just "works". I changed the config back to the prompt and I ran a "backup now" and it's working.

Is there a place to put the keystroke needed? Or is it always "x"?
User avatar
Tomas
Posts: 1206
Joined: Sat Jun 25, 2016 12:33 pm

Fri Dec 17, 2021 10:37 pm

doslager wrote:
Fri Dec 17, 2021 10:26 pm
Nevermind! I see it just "works". I changed the config back to the prompt and I ran a "backup now" and it's working.

Is there a place to put the keystroke needed? Or is it always "x"?
We added this as a part of our behavior tree - Unimus will intelligently recognize menus of this type, and determine automatically which keystroke is needed to proceed. Basically, it should "just work" in all cases - even if you change the key to proceed, or even if the menu structure is a little different.
doslager
Posts: 10
Joined: Mon Oct 25, 2021 10:37 pm

Sat Dec 18, 2021 7:11 pm

Thank you! I appreciate the work! :) :)
Post Reply