Using Python to log into Looking Glass servers

I’m writing a python script that ssh’s into a looking glass server. The Looking Glass server doesn’t require a password, only a username. I keep getting an authentication failure with the following script:

**********************************************************************from netmiko 

import ConnectHandler

print('connecting to routeviews.org')
routeViews = ConnectHandler(ip='route-views.routeviews.org',
                            username='rviews',
                            password=None,
                            device_type='cisco_xe')

print('checking version')
routeViews.send_command('terminal length 0')
routeViews.send_command('show version')
**********************************************************************

I’m not sure how to send the username without a password. I tried using “None” in my example above. Any thoughts?
thank you.
Bruce

You can use ‘’ as a password.

from netmiko import ConnectHandler

print('connecting to routeviews.org')
routeViews = ConnectHandler(ip='route-views.routeviews.org',
                            username='rviews',
                            password='',
                            device_type='cisco_xe')

print('checking version')
print(routeViews.send_command('terminal length 0'))
print(routeViews.send_command('show version'))
1 Like

Giovanni,

That worked.

Thank you.
Bruce

1 Like