10-16-2019 11:24 PM
Hi Guys.
Im having an issue with logging into our devices that are on ISE. Im assuming the problem is with the regex not matching the login prompt, or expecting a username prompt which is not there? not sure. I have added an new regex in the my_testbed file and also tried a direct connection using unicors with the following commands:
dev = Connection(hostname='1DP-xxxxxxxxxxx-SW1',
start=['ssh 10.11.122.98'],
credentials={'default': {'username': 'axxxxxxx', 'password': 'xxxxxxxxxx'}},
os='iosxe')
dev.settings.LOGIN_PROMPT = r'TI-Pass:\s?$'
dev.settings.PASSWORD_PROMPT = r'PASSWORD:\s$'
here is my testbed file:
>>> dev.connect() TI-Pass: [2019-10-17 06:07:58,386] +++ connection to spawn: ssh -l adam1 10.11.122.29, id: 139699542466176 +++ [2019-10-17 06:07:58,386] connection to 1DP-BASEMENT-1A-ST1-SW1 Traceback (most recent call last): File "src/unicon/statemachine/statemachine.py", line 703, in unicon.statemachine.statemachine.StateMachine.go_to File "src/unicon/statemachine/statetransition.py", line 486, in unicon.statemachine.statetransition.AnyStateTransition.do_transition s File "src/unicon/eal/dialogs.py", line 420, in unicon.eal.dialogs.Dialog.process File "src/unicon/eal/dialog_processor.py", line 293, in unicon.eal.dialog_processor.SimpleDialogProcessor.process File "src/unicon/eal/dialog_processor.py", line 252, in unicon.eal.dialog_processor.SimpleDialogProcessor.timeout_handler unicon.core.errors.TimeoutError: timeout occurred: timeout value: 60 last_command: 'ssh -l adam1 10.11.122.29' pattern: ["r'TI-Pass:\\s?$", '^.*?% (Bad passwords|Access denied|Authentication failed)', '^.*Login incorrect', '^.*([Uu] sername|[Ll]ogin): ?$', '^.*User Access Verification', '^.*[Pp]assword( for )?(\\S+)?: ?$', '^(.*)Kerberos: No default realm defined f or Kerberos!', '^.*(initial|basic) configuration dialog ?\\?? ((\\[yes.*\\])|(\\(yes/no\\))|(\\(yes/no\\) (\\[y\\]))):', 'Would you li ke to enter basic management setup\\? \\[yes/no\\]:', 'Escape character is .*\\n', '^.*RETURN to get started', 'Are you sure you want to continue connecting \\(yes/no\\)', '^.*(Connection refused|Connection reset by peer|Network is down|closed by remote host)', 'Recei ved disconnect from .*:', 'Hit Enter to proceed:', '^(.*?)Press Ctrl\\+x to Exit the session', '^(.*?)Connected.', '^.*[Pp]assword( fo r )?(\\S+)?: ?$', '^.*?% (Bad passwords|Access denied|Authentication failed)', '^.*System config(uration)? has been modified\\. Save\\ ?.*$', '^.*Are you sure you want to reset the system \\(y\\/n\\)\\?', '^.*Reload node \\? \\[no,yes\\]\\s?$', '^.*Proceed( with reload )?\\? *\\[confirm\\]', '^.*Press RETURN to get started.*', '^.*User Access Verification', '^(.*)Uncommitted changes found.*?', '^.*(in itial|basic) configuration dialog ?\\?? ((\\[yes.*\\])|(\\(yes/no\\))|(\\(yes/no\\) (\\[y\\]))):', '^(.*)Would you like to terminate a utoinstall\\? ?\\[yes\\]: $', '^.*Do you want to reload the internal AP\\s?\\? ((\\[yes/no\\]\\??)|(\\[y/n\\]\\??)):?\\s?$', '^.*Do yo u want to save the configuration of the AP\\s?\\? ((\\[yes/no\\]\\??)|(\\[y/n\\]\\??)):?\\s?$', '^(.*)This command will reboot the sys tem. \\(y\\/n\\)\\? \\[n\\]\\s?$', '^.*Do you want to enforce secure password standard(\\?)? \\(yes\\/no\\)( \\[[yn]\\])?\\: ?', '^.* (Enter|Confirm) the password for .*admin', 'Abort( Power On)? Auto Provisioning .*:', '^.*([Uu]sername|[Ll]ogin): ?$', '^.*[Pp]assword ( for )?(\\S+)?: ?$', '^.*?% (Bad passwords|Access denied|Authentication failed)', '^.*Login incorrect', '^.*([Uu]sername|[Ll]ogin): ? $', '^.*User Access Verification', '^.*[Pp]assword( for )?(\\S+)?: ?$', '^(.*)Kerberos: No default realm defined for Kerberos!', '^.*( initial|basic) configuration dialog ?\\?? ((\\[yes.*\\])|(\\(yes/no\\))|(\\(yes/no\\) (\\[y\\]))):', 'Would you like to enter basic ma nagement setup\\? \\[yes/no\\]:', 'Escape character is .*\\n', '^.*RETURN to get started', 'Are you sure you want to continue connecti ng \\(yes/no\\)', '^.*(Connection refused|Connection reset by peer|Network is down|closed by remote host)', 'Received disconnect from .*:', 'Hit Enter to proceed:', '^(.*?)Press Ctrl\\+x to Exit the session', '^(.*?)Connected.', '^(.*)Please reset', '^(.*)(rommon(.*)) +>.*$', '^.*(Enter|Confirm) the password for .*admin', '^.*(initial|basic) configuration dialog.*\\s?', '^(.*)Would you like to termin ate autoinstall\\? ?\\[yes\\]: $', '^.*Are you sure you want to continue\\? \\[y/n\\]\\s?.*$', '^(.*?)\\[1DP-BASEMENT-1A-ST1-SW1.*\\]\ \$\\s?$', 'rommon[\\s\\d]*>\\s?$', '^(.*)\\(.*(con|cfg|ipsec-profile)\\S*\\)#\\s?$', '^(.*?)(Router|Switch|ios|switch|1DP-BASEMENT-1A- ST1-SW1)(\\(standby\\))?(-stby)?(\\(boot\\))?#\\s?$', '^(.*?)(Router|Switch|ios|switch|1DP-BASEMENT-1A-ST1-SW1)(\\(standby\\))?(-stby) ?(\\(boot\\))?>\\s?$', '^.*--\\s?[Mm]ore\\s?--.*$'] buffer:'TI-Pass:' The above exception was the direct cause of the following exception: |
Please help, im really amped to get this implimented :(
10-28-2019 06:41 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide