Giter VIP home page Giter VIP logo

napalm-hp-procurve's Introduction

napalm-procurve

NAPALM driver for HPE ProCurve networking gear.

Supported devices

All ProCurve OS devices should be supported. The code has been written and tested having access to ProCurve 2848 and to E2910al-48G-PoE devices.

If a different device or a different firmware release should cause problems, please open a GitHub issue and paste the appropriate output from the switch.

Development status

The driver is functional and can be used to poll status information:

  • get_facts(): Return general device information
  • get_lldp_neighbors(): Fetch LLDP neighbor information
  • get_lldp_neighbors_detail(): Fetch LLDP details
  • get_environment(): CPU and Sensor details
  • get_config(): Read config
  • ping(): Ping remote ip
  • get_ntp_servers(): Return configured NTP servers
  • get_arp_table(): Get device ARP table
  • get_mac_address_table(): Get mac table of connected devices
  • get_interfaces(): Get interface status
  • get_interfaces_counters(): Get interface counters

Configuration changes are currently not supported, as the ProCurve OS does not support an API to do changes in a decent way. Incremental changes might be possible, but are difficult to implement. Complete configuration uploads via sftp might be an option but have the drawback that they cause an immediate reboot of the ProCurve device.

Maybe a later version will support configuration handling.

How to use

Install napalm and install napalm-procurve via pip:

$ pip install napalm napalm-procurve

In case the latest development checkout is needed:

$ pip install git+https://github.com/ixs/napalm-procurve.git

Test functionality:

#!/usr/bin/env python3
# Simple napalm-procurve test

import json
from napalm import get_network_driver

driver = get_network_driver("procurve")

# Uncomment if you need debug logging of the raw commands sent to the
# device and any data received
#import logging
#logging.basicConfig(filename="procurve.debug.log", level=logging.DEBUG)
#logger = logging.getLogger("netmiko")

driver = get_network_driver("procurve")

device = driver(
    "10.0.0.254",
    "manager",
    "secret",
    optional_args={"ssh_config_file": "~/.ssh/config", "port": 22},
)
device.open()

vals = device.get_mac_address_table()
device.close()
print(json.dumps(vals, sort_keys=True, indent=4, separators=(",", ": ")))

License

ASL2.0

napalm-hp-procurve's People

Contributors

carsten-aei avatar ixs avatar pieterdejaeghere avatar vebis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

napalm-hp-procurve's Issues

get_lldp_neighbors

get_lldp_neighbors() and get_lldp_neighbors_detail() fails on JL070A HPE 2530-8-poe running YB.16.08.0001 with KeyError: ChassisId... immediate issue looks like truncation occurs and SNMP is attempted but ChassisId is not a valid key in the key_mib_table. Attempts to add {'ChassisId': 'LldpChassisId'} to the dict did not help.

driver = get_network_driver('procurve')

device = driver('192.168.1.60', '', 'manager', optional_args={'ssh_config_file': '~/.ssh/config', 'port': 22})
device.open()
vals = device.get_lldp_neighbors_detail()

device.close()
print(json.dumps(vals, sort_keys=True,
                 indent=4, separators=(',', ': ')))

Grabbing LLDP RESULTS

opened Device connection
Traceback (most recent call last):
  File "hpcollector.py", line 14, in <module>
    vals = device.get_lldp_neighbors()
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 305, in get_lldp_neighbors
    remote_port, device_id = self._get_lldp_neighbors_detail(
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 372, in _get_lldp_neighbors_detail
    tmp_lldp_details = self._lldp_detail_parser(interface)
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 411, in _lldp_detail_parser
    '{}.0.{}.1'.format(key_mib_table[key], ifs[interface]))
KeyError: 'ChassisId'

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.