cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
136
Views
0
Helpful
1
Replies
Beginner

PyATS and ISE connection failure with renamed prompt.

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:

devices:
 1DP-Txxxxxxxxxx-SW:
  type: 'switch'
  os: 'iosxe'
  platform: CAT3K
  alias: 'test'
  tacacs:
   username: axxxxxx
  passwords:
   tacacs: xxxxxxxxx
  connections:
   cli:
    protocol: ssh
    ip: "10.1xxxxxxx98"


 1DP-xxxxxxxxxxx-SW1:
  type: 'switch'
  os: 'iosxe'
  platform: CAT3K
  alias: 'uut'
  credentials:
   default:
    username: axxxxx
    password: xxxxxxx
  connections:
   cli:
    protocol: ssh
    ip: "10.1xxxxx.29"
    prompts:
     login: r'TI-Pass:\s?$
 
I have tried both switches with the same error....super confused now. I dont have an issue logging into a switch not on ISE.
 
here is the output.
>>> 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 :(

Everyone's tags (3)
1 REPLY 1
Beginner

Re: PyATS and ISE connection failure with renamed prompt.

Im a bit worried about Cisco Support at the moment.
CISCO COBRA SDK only supports 2.7 which is depricated in a month and now pyATS looks like there is no community either?
Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.