question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aruba_os ssh connection issue / send_command_expect

See original GitHub issue

Hi,

I’ve discover this weekend Netmiko and started to code some basic script that will run a certain command file based on show version, i.e: either it’s a Cisco / HP / or Aruba, I can confirm that the script is successfully working for a IOS, but I was testing the connection with aruba and somwhow the script output the following:

Checking for 7150
Traceback (most recent call last):
  File "nettools6.py", line 70, in <module>
    output_version = net_connect.send_command('show version')
  File "/usr/local/lib/python2.7/site-packages/netmiko/base_connection.py", line 1188, in send_command
    search_pattern))
IOError: Search pattern never detected in send_command_expect: SSH\@BOH\-switch\#

while it seems that the SSH session is connection is established however the script cannot run the show version,

I’ve try different device_type ( aruba_os / brocade_fastiron ) mainly but no go - models used is an Brocade ICX7150-48

here is the script, at this point it might be an issue on how I handle different model type of switch ( I’m working in a variety of switches from Cisco to HP to ICX

pastebin of the script itself: https://pastebin.com/rWcfKVjk

the code might need a bit of cleanup but it’s work in progress, any suggestion would be welcome

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nexty5870commented, Oct 29, 2018

Looks like we have a positive result in using ruckus_fastiron I can get the show version display, I need to troubleshoot the code since it return some other error ( I’m sure my way of handeling multiple model is wrong)

Traceback (most recent call last): File “nettools6.py”, line 97, in <module> print output NameError: name ‘output’ is not defined

for devices in devices_list:
	print 'Connecting to device...'' ' + devices
	ip_address_of_device = devices
	hp_device = {
	'device_type': 'ruckus_fastiron',
	'ip': ip_address_of_device,
	'username': username,
	'password': password,
	'session_log': 'output.txt'
	}
...

	try:
		net_connect = ConnectHandler(**ios_device)
		net_connect_hp = ConnectHandler(**hp_device)

	if software_ver == 'ICX7150-48' : 
		print 'Running ' + software_ver + ' commands'
		output = net_connect_hp.send_config_set(commands_list_icx)
         print output
0reactions
nexty5870commented, Oct 29, 2018

thanks, I’ll try to debug mine as it seems to be stuck somewhere down there, I’m not a python pro but I’ll see what I can do, thanks again!

Checking the software/type version

for software_ver in list_versions:
	print 'Checking for ' + software_ver
	output_version = net_connect.send_command('show version')
	int_version = 0 # Reset integer value
	int_version = output_version.find(software_ver)  # checking software version / models type
	if int_version > 0:
		print 'Software version found: ' + software_ver
		break
	else:
		print 'Did not find ' + software_ver

if software_ver == 'ICX7150-48' : 
	print 'Running ' + software_ver + ' commands'
	output = net_connect_icx.send_config_set(commands_list_icx)
elif software_ver == 'WS-C3': 
	print 'Running ' + software_ver + ' commands'
	output = net_connect.send_config_set(commands_list_ios)
elif software_ver == 'HP': 
	print 'Running ' + software_ver + ' commands'
	output = net_connect_hp.send_config_set(commands_list_hp)
print output	
Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH connection problem with an HP switch in ArubaOS
Hello,I have a problem with HP switch under ArubaOS.I try to connect by SSH on it, with Ansible (it is a platform that...
Read more >
Aruba Controller AOS 8 SSH issue after login #1252 - GitHub
Hi I got an issue when trying to connect to Aruba Controller AOS 8. I am a beginner in Python so appreciate your...
Read more >
Document - HPE Aruba Switches - SSH Configuration
FIX: This document describes the basic configuration steps to enable SSH access to HPE Aruba switches: Steps: IP configuration Username/password [crypto key ...
Read more >
CLI Reference Guide for ArubaOS-CX ... - Aruba SE Club
Side-by-side comparison—Provides a table of the basic commands required to execute a given function in each of the operating systems.
Read more >
Useful CLI Commands for Aruba OS 8 Troubleshooting - WifiHax
I prefer and recommend using this method over opening a direct SSH session to the single controller. Take a look at the ap-debug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found