ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.63k stars 1.31k forks source link

Access with Netmiko in OLT MA5800 (Huawei Integrated Access Software) #3044

Closed RecsC closed 1 year ago

RecsC commented 2 years ago

@ktbyers @tbotnz @MrPaulAR Any idea how I can access an OLT MA5800 (Huawei)!!??

I'm trying to access a huawei device (OLT MA5800) but I have the timeout error according to the logg below. image

Note that for Huawei ATN 910C-G routers, I can access and execute commands with the Login below(in the same way that I try to access the OLT). huawei_ios = { 'device_type': 'huawei', 'host': IP, 'username': Username, 'password': Password, 'global_delay_factor': 0.1 } net_connect = ConnectHandler(**huawei_ios)

Normal access via ssh: image

ktbyers commented 1 year ago

Did you try the huawei_olt device type?

RecsC commented 1 year ago

Hi @ktbyers , Thank you for your availability and help.

I changed it to "Huawei_OLT" and I see that I can now access it. In the image below marked in green I see the question that the OLT asks when accessing the element. But now I have an exception error there marked in red.

Summary: when accessing the equipment, we must accept the "YES" or "Y" statement, otherwise we cannot execute/send any command.(You can also see it in the image above) How can I send the "Y" when sending the ConnectHandler.

I need to send a yes and have full access

image

ktbyers commented 1 year ago

Does it do this every time or only the first time you login?

Can you disable this behavior via configuration?

Someone would need to write a special handler to handle this. This device has something similar:

https://github.com/ktbyers/netmiko/blob/develop/netmiko/calix/calix_b6.py#L29

Ping me in a week or so and I might see if I can do it.

RecsC commented 1 year ago

@ktbyers hi!

Does it do this every time or only the first time you log in? Answer: Yes.

Can you disable this behavior via configuration? Answer: It can be removed, but as good practice it should remain. It is hereby accepted the statements and terms above the above law.

Ping me in a week or so and I might see if I can do it. Answer: In a week and a half to two weeks I'll give you a signal again.

I reiterate: I really appreciate your dedication and help, with that many, many more processes will be automated, similar to those made with CISCO equipment.

RecsC commented 1 year ago

hi @ktbyers any news for me!?

ktbyers commented 1 year ago

I didn't do anything on this yet. Probably won't get to it for two more weeks.

ktbyers commented 1 year ago

Reminder to myself to work on this.

ktbyers commented 1 year ago

@RecsC Can you test this proposed fix?

https://github.com/ktbyers/netmiko/pull/3099

ktbyers commented 1 year ago

Should be fixed in the referenced PR which I merged into the develop branch.

RecsC commented 1 year ago

Hi @ktbyers, thank you very much for your help and availability.

I saw your proposed solution #3099, but I'm still very lost. Please help me better with the shared code.

Or do I just need to upgrade Netmiko?

Let's imagine for the login code below how to incorporate the created solution(https://github.com/ktbyers/netmiko/pull/3099):

from netmiko import ConnectHandler

net_connect = ConnectHandler( device_type="huawei_olt", host="10.10.10.10", username="admin", password="password", ) output = net_connect.send_command("display interface description") print(output)

I look forward to feedback, Thanks.