Guys,
I am struggling to make a python3 script work my Aruba/HP_Procurve switches. I have taken it down to a basic format but still no luck. It works fine for most "show" commands except if I use "sh time" or "sh up time". If one of those command is used, the output runs a bit together. I'm happy to give Platinum award for correct script (1 month of reddit prem).
Here is an example of the output where I run the "sh version' command then the "show time" command.: (running 16.0x firmware version on switches)
Boot ROM Version: KA.15.10
Active Boot ROM: Primary <--- End of "show version" command
ed Mar 13 15:06:09 2019 <--- Begin "sh time. Should say Wed, not ed, and no newline
Script complete.
Code snippet:
aruba = {
'device_type': 'hp_procurve',
'username': username,
'password': p,
# 'global_delay_factor': 2,
}
net_connect = ConnectHandler(**aruba)
output = net_connect.send_command("show ver")
output += net_connect.send_command("show time")
print (output)
No comments:
Post a Comment