Christian Manivong e0ff997d1b
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 25s
driver / types (pull_request) Successful in 1m15s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 29s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 2m54s
driver / publish (pull_request) Skipped
fix(config): read what retrieve asks in the REST-to-SSH fallback
A switch whose REST API has no configuration is read over a temporary
SSH session. That path read the running config only, whatever retrieve
asked for, and returned an empty startup config. It now reads through
the same code as the SSH transport: running and/or startup as asked,
"show config" where "show startup-config" is unknown, and a part that
could not be read raises.

Closes #25
2026-11-02 09:15:03 +01:00

napalm-hpe-aruba-procurve

NAPALM driver for HPE / Aruba ProCurve switches — from ancient 2520G-8-PoE to modern 2530/2540 series.

Transport auto-detection

The driver probes transports in order and uses the first one that succeeds:

Priority Transport Notes
1 REST API (HTTPS → HTTP, v7 → v6) Newer 2530/2540 with rest-interface enabled
2 SSH (standard) hp_procurve netmiko driver
3 SSH (legacy KEX) Forces older kex/cipher negotiation for 2520G-8-PoE etc.
4 Telnet Oldest devices without SSH or with broken SSH

Override the transport with optional_args={"transport": "ssh_legacy"} to skip auto-detection.

Host verification

The switch's identity is checked before any password is sent, on every transport that has one (napalm-device-types):

  • SSH: the host key, trust on first use: optional_args["ssh_host_keys"] holds the key to expect, optional_args["ssh_host_key_observer"] receives the one seen.
  • REST API over HTTPS: the certificate, by its SHA-256 fingerprint and not by a CA (ProCurves ship self-signed certificates), trust on first use: optional_args["tls_fingerprints"] = {"443": "SHA256:AB:CD:…"} holds the fingerprint to expect, optional_args["tls_certificate_observer"] receives the one seen. Without a fingerprint the first certificate is accepted.

A refused host key or certificate ends open() with a ConnectionException naming both fingerprints. The driver does not try the next transport then: it would reach the same host with the same password, over Telnet in clear text. Plain HTTP REST has no certificate to check: a switch with a pinned certificate is not logged in to over it.

Switch prerequisites

REST API (newer switches, e.g. 2530, 2540)

web-management ssl
rest-interface
rest-interface session-idle-timeout 120

SSH (all ProCurve)

crypto key generate ssh rsa
ip ssh

Telnet is enabled by default on most ProCurve switches.

Installation

pip install napalm napalm-hpe-aruba-procurve

Or from source:

git clone https://git.netork.io/NAPALM/napalm-hpe-aruba-procurve
pip install -e napalm-hpe-aruba-procurve/

Quick start

from napalm import get_network_driver

Driver = get_network_driver("procurve")

with Driver(
    "10.0.0.1",
    "manager",
    "secret",
    optional_args={
        # "transport": "ssh",          # force transport (api/ssh/ssh_legacy/telnet)
        # "port": 22,
        # "tls_fingerprints": {"443": "SHA256:AB:CD:…"},  # REST certificate to expect
        # "api_version": "v7",         # API version hint (v3/v6/v7)
        # "secret": "enablepassword",  # enable password for CLI
    },
) as dev:
    print(dev.get_facts())
    print(dev.get_interfaces())

Supported NAPALM methods

Method API SSH/Telnet
open() ✅ ✅
close() ✅ ✅
is_alive() ✅ ✅
get_facts() ✅ ✅
get_interfaces() ✅ ✅
get_interfaces_ip() ✅ ✅
get_arp_table() ✅ ✅
get_mac_address_table() ✅ ✅
get_lldp_neighbors() ✅ ✅
get_lldp_neighbors_detail() ✅ ✅
get_config() ✅ ✅
get_ntp_servers() ✅ ✅
get_environment() ❌ ✅
get_users() ❌ ✅
get_snmp_information() ❌ ✅
ping() ✅ ✅
cli() ✅ ✅
load_merge_candidate() ❌ ✅
load_replace_candidate() ❌ ✅
compare_config() ❌ ✅
commit_config() ❌ ✅
discard_config() ❌ ✅
rollback() ❌ ✅

Tested devices

  • HP ProCurve 2520G-8-PoE (J9565A) — SSH legacy / Telnet
  • HP ProCurve 2920-48G — SSH
  • Aruba 2530-8-PoE+ — SSH + REST API

License

Apache 2.0

S
Description
No description provided
Readme
1.1 MiB
0 Stars 1 Watchers 0 Forks
2026-10-23 12:53:07 +00:00
Languages
Python 100%