Giter VIP home page Giter VIP logo

netmiko's People

Contributors

ahmadbarrin avatar broncofan avatar carlmontanari avatar cuongnguyenduy avatar dynax60 avatar ggabriele avatar jcrotts avatar jobec avatar jumpojoy avatar ktbyers avatar lamiskin avatar lindsayhill avatar maximumg avatar mileswdavis avatar mirceaulinic avatar mww012 avatar nmisaki avatar nmusser avatar plucena24 avatar ravenblue12 avatar rollerr avatar rptetzloff avatar smk4664 avatar static0verride avatar supertylerc avatar tknv avatar tonypnode avatar tyler-8 avatar vnznznz avatar ylebiannic avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

markom84

netmiko's Issues

[Huawei SmartAX] Support for send_command

Huawei SmartAX devices sometimes shows an extra prompt that you need to handle with a return for a lot of commands, here is an example:

device#display current-configuration
{ <cr>|ont<K>|port<K>|section<K>|service-port<K>|simple<K>||<K> }:

To progress with obtaining the output, a return needs to be sent. The current update handles this in a 'hacky' way and just sends a return if { <cr is found in the output. However there must be a cleaner solution to this problem.

[Huawei SmartAX] Support for send_config_set

Currently uses the Cisco Base Class, however issues occur with some commands that prompt that additional commands, prompt example below:

{ <cr>|wrr-weight<K> }:

This prompt doesn't appear with commands like:

device(config)#sysname testlab.xyz

[Huawei SmartAX] Support for disable_paging

Huawei SmartAX devices can use the command scroll to disable the paging output. However, you need to manually send a return after the command scroll because of the following prompt as shown below:

device>scroll
{ <cr>|number<U><10,512> }:

This is currently handled by the disable_paging method to use send_command instead of write_channel. Not entirely sure if I should use the send_command or fix this up slightly...

Intensive testing for supported commands

Example of a working script using the huawei_smartax device_type:

config_set = [
            'undo acl 2224',
            'acl 2224',
            'rule permit source 192.0.2.0 0.0.0.3',
            'rule permit source 192.0.2.4 0.0.0.3',
            'rule permit source 192.0.2.8 0.0.0.3'
        ]

        if ssh_device:
            ssh_device.enable()
            find_acl_2224 = ssh_device.send_command("display current-configuration | include acl 2224")
            if "acl 2224" in find_acl_2224:
                print("found acl 2224\n", "send_config_set test...")
                print(ssh_device.send_config_set(config_set))
                output = ssh_device.send_command("display acl 2224")
                if output:
                    print(output)
            else:
                print("ACL not found...")

Output:

$ python huawei_general_testing.py 
found acl 2224
 send_config_set test...
config

huawei.test-lab.xyz(config)#undo acl 2224

huawei.test-lab.xyz(config)#acl 2224

huawei.test-lab.xyz(config-acl-basic-2224)#rule permit source 192.0.2.0 0.0.0.3

huawei.test-lab.xyz(config-acl-basic-2224)#rule permit source 192.0.2.4 0.0.0.3

huawei.test-lab.xyz(config-acl-basic-2224)#rule permit source 192.0.2.8 0.0.0.3

huawei.test-lab.xyz(config-acl-basic-2224)#return

huawei.test-lab.xyz#
Basic ACL  2224, 3 rules
Acl's step is 5
 rule 5 permit source 192.0.2.0 0.0.0.3 (0 times matched) 
 rule 10 permit source 192.0.2.4 0.0.0.3 (0 times matched) 
 rule 15 permit source 192.0.2.8 0.0.0.3 (0 times matched) 

Intensive testing will be in place to try to break the Netmiko device_type huawei_smartax.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.