Netmiko: hpe comware7 is not working

Created on 18 May 2016  路  26Comments  路  Source: ktbyers/netmiko

Also add the following names:

hpe_procurve
hpe_comware5
hpe_comware7

All 26 comments

So far I have not seen any major problems with Comware 7. I'm using netmiko scripts with Comware 5 and 7. The only thing which I have noticed, is that it is not working with operator rights as it looks like that screen-length disable doesn't work with operator rights.

@wmann Strange, I just tried to run a script against Comware7 and it crashed trying to determine the prompt.

I will have to look into it some more...

Tested again with netmiko 0.4.3 and 0.5.1 both running under Windows 8.1 with python 2.7.11 and I don't see any problems. Switch is a 5510 HI running HPE Comware Software, Version 7.1.045, Release 1118P02

I had someone report the following on Comware7:

Traceback (most recent call last):
  File "/Python4Network/SSH/ssh_to_mulitple_routers4.py", line 52, in <module>
    net_connect = ConnectHandler(**router)
  File "/Library/Python/2.7/site-packages/netmiko/ssh_dispatcher.py", line 84, in ConnectHandler
    return ConnectionClass(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/netmiko/base_connection.py", line 69, in __init__
    self.session_preparation()
  File "/Library/Python/2.7/site-packages/netmiko/hp/hp_comware_ssh.py", line 12, in session_preparation
    self.set_base_prompt()
  File "/Library/Python/2.7/site-packages/netmiko/hp/hp_comware_ssh.py", line 56, in set_base_prompt
    if not prompt[-1] in (pri_prompt_terminator, alt_prompt_terminator):
IndexError: string index out of range

Which switch and which Comware version? If you provide me with the script I will test it against my Comware 7 switches

@wmann It was failing to connect (basically where the script tries to determine the prompt after login). I am asking about the switch and comware version.

More info:

This switch works:

HP 5900AF-48XG-4QSFP+
HP Comware Software, Version 7.1.045, Release 2307

This switch does not work:

HP FF 12916
HP Comware Software, Version 7.1.045, Release 1135

I have seen this error today at one of our switches in the Lab. Switches were configured for radius login while the radius server were not reachable. After disabling radius login it works. So it seems to be a timing issue. I currently use 'global_delay_factor': 5, I also tried 10 but it still didn't work.

I made an update to set_base_prompt() for comware7. I need to test this as I temporarily have lost access to my comware7 test device.

059cf548c2a2c92b469c6926c471c91c935c9ea7

If you provide me with the tests I can run them

@wmann I got access to a Comware7 device so I started testing it.

Hi Kurt,

Following up on this, I have script logging in to Comware devices which produces the following as the error: -

Router prompt not found: ********************************************************************************

My guess is that because we have login banners, it's taking them as the base prompt.

Is it possible to manually define the base prompt as part of the ConnectHandler? I know what I expect to see as the base prompt, so it would get round the issue for now.

This doesn't affect all devices, so far I am seeing this work fine on: -

| Device Type | Comware Version |
| --- | --- |
| A5800-48G | Comware 5 |
| HSR6808 | Comware 7 |
| A7503 | Comware 5 |

These are the troublesome ones though: -

| Device Type | Comware Version |
| --- | --- |
| HPE 5900AF-48XG-4QSFP+ | Comware 7 |
| HPE 6125XLG | Comware 7 |
| HPE 6127XLG | Comware 7 |

If you want exact firmware versions, let me know

To add to my previous comment, I bumped up the global delay factor and everything has kicked back into life, so I'm guessing it might be trying to grab the base prompt too quick?

Again, I wouldn't be surprised if this is down to us using quite large login banners and the time it takes to get through them.

I have access to a Comware7 device so let me test it with a large banner and see if I can reproduce the behavior you are seeing and then improve it.

Thank you, if you need any testing or want me to check behaviour on our fleet of devices (we're a HP Comware house so have a variety to test with) then let me know.

Also a massive thank you for Netmiko, it's brilliant and making automating our network side a lot easier.

Would be good to add a fudge for the HPE 1920 at some stage.

@bms What is needed for the HPE 1920?

@stuh84 FYI, I pushed up this fix the HP comware banner issue (https://github.com/ktbyers/netmiko/commit/5e436e61b508e70926e933ed64ee6f777df694b9).

Let me know if you are still seeing "Router Prompt not found" login issues. You should not need to adjust the global_delay_factor for this to work properly.

Much appreciated! I'll give it a go when I'm back in work on Monday.

@ktbyers - Works perfectly now, I've taken out the global_delay_factor from my ConnectionHandler now and I didn't get a single failure. My script runs a LOT faster now too.

Thanks for fixing this!

I am facing issues with this error:- Router prompt not found.
I am trying to achieve ssh functionalities for cisco aci in our infrastructure..

@sindhujit That is a very generic error...if you are not using HPE Comware7, please open a new issue on GitHub.

Hello everyone,

I have HP MSR2003 router. IOS version is HPE Comware 7.1.059. I am unable to login. Any suggestions??

@ram2711 Can you post the relevant section of your code and the exception that you receive?

@ram2711 Also please open a new issue for this.

@ktbyers It was a mistake in dictionary variable where the device details are mentioned. I got it corrected. Sorry for the trouble. Thank you so much for the concern. Your work has helped me a lot. Thanks a ton. :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajaramanlala picture rajaramanlala  路  7Comments

MichalTaratuta picture MichalTaratuta  路  7Comments

jebron picture jebron  路  5Comments

Rooster-OC picture Rooster-OC  路  5Comments

ktbyers picture ktbyers  路  5Comments