Commit Graph
63 Commits
Author SHA1 Message Date
Christian Manivong 586632efe0 Merge remote-tracking branch 'origin/main' into fix/rest-cert-tofu-17
The REST login now checks the certificate before it posts the password
(#17) and then tells a web page from a refused login (#13); the two
login-answer checks moved into _require_login so connect() stays within
the function-length limit. #13's REST tests stand in for the switch's
certificate, since connect() fetches it before the login.
2026-11-02 00:37:11 +01:00
christianmanivong 9bce1b4e47 Merge pull request 'fix: REST side session port, connect reasons, SNMP config over REST (#17, #13, #10)' (#21) from fix/bugs-2026-11 into main
driver / standard (push) Successful in 19s
driver / lint (push) Successful in 16s
driver / types (push) Successful in 1m19s
driver / test (3.12) (push) Successful in 1m10s
driver / lowest (push) Successful in 31s
driver / test (3.13) (push) Successful in 1m16s
driver / build (push) Successful in 35s
driver / security (push) Successful in 1m15s
CI / driver (push) Successful in 3m0s
driver / publish (push) Skipped
2026-11-01 22:00:19 +00:00
Christian Manivong e51ddcd151 fix(rest): no plain-HTTP login for a switch with a pinned certificate
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Failing after 1m9s
driver / test (3.13) (pull_request) Failing after 1m0s
driver / lowest (pull_request) Failing after 29s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m17s
CI / driver (pull_request) Failing after 3m1s
driver / publish (pull_request) Skipped
The probe falls back to HTTP when HTTPS does not answer. For a switch
known by its certificate that is a downgrade anyone who blocks port 443
can force: the login would go out in clear text, unchecked. With a
pinned fingerprint the REST API is skipped then and the CLI transports
are tried; without one, plain HTTP is used as before.

Refs #17
2026-11-01 22:24:30 +01:00
Christian Manivong cb7268b89c fix(rest): verify the API certificate by its fingerprint
The REST login never verified the switch in practice: with ssl_verify
off nothing was checked, and with it on a self-signed certificate (the
one every ProCurve ships) failed the CA check and the login was retried
with verification off. Either way the password went to whatever answered
on port 443.

The certificate is now checked by its SHA-256 fingerprint, trust on
first use (napalm-device-types tls_certificates): the caller passes the
fingerprint to expect in optional_args["tls_fingerprints"] and receives
every one seen through optional_args["tls_certificate_observer"]. A
different certificate ends open() with TlsCertificateMismatch before the
password is sent, without trying SSH or Telnet, which would reach the
same host with the same password. The session is pinned to the checked
certificate for every later connection. ssl_verify no longer has an
effect, and the unverified retry is gone.

Closes #17
2026-11-01 22:18:33 +01:00
Christian Manivong 1d5399e51b fix(cli): decode the REST CLI answer
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / test (3.13) (pull_request) Successful in 49s
driver / lowest (pull_request) Successful in 24s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 56s
CI / driver (pull_request) Successful in 2m25s
driver / publish (pull_request) Skipped
Over the REST API, cli() returned the /cli endpoint's
result_base64_encoded field as it came: base64 instead of the command's
output. It now decodes it and drops the NUL byte the switch ends it with,
in the same parser the SNMP read over REST uses.

New finding, confirmed by the show snmp-server answer recorded from a
ProCurve switch; no issue filed.
2026-11-01 22:17:59 +01:00
Christian Manivong 03cf40de99 test(snmp): use the recorded show snmp-server
The #10 tests read a hand-written show snmp-server. They now read the
output recorded from a ProCurve switch: as the CLI prints it, and as the
REST /cli endpoint answers it, base64 with a trailing NUL byte. The
trap receiver's address is replaced. The read-only preference and the
no-community case put a line into, or take one out of, the recording.
2026-11-01 22:16:51 +01:00
Christian Manivong b26584c7da fix(snmp): read the communities over the REST API too
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 56s
driver / test (3.13) (pull_request) Successful in 47s
driver / lowest (pull_request) Successful in 25s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 1m6s
CI / driver (pull_request) Successful in 2m29s
driver / publish (pull_request) Skipped
get_snmp_config sent "show snmp-server" through the CLI session, which
does not exist on the REST transport, and returned None, so every switch
managed over REST read as "SNMP not configured". Over REST the command
now runs through the API's /cli endpoint and the output goes through the
parser the SSH path uses. A failed REST read raises.

Closes #10
2026-11-01 21:51:06 +01:00
Christian Manivong ee49948b2b fix(connect): name a full switch and a web page, not a bad password
A switch whose Telnet sessions were all taken, and a REST API answering
the login with the web UI's HTML page, were both reported as an
authentication failure, which sent the operator after the password. The
Telnet login now keeps the switch's greeting in an in-memory session log
and reports a full switch as a connection error; an HTML answer to the
REST login says so. An SSH attempt records netmiko's underlying error
instead of "timed out" when it was not a timeout.

Session log objects need netmiko 4.3.0, which becomes the floor.

Closes #13
2026-11-01 21:48:56 +01:00
Christian Manivong 874e25a1ce fix(snmp): open the REST side session's SSH on port 22
configure_snmp_agent over the REST API opened its temporary SSH session
on optional_args["port"], which names the REST API's port when REST is
the transport. It now uses port 22, as the running-config fallback
already did.

The second finding of the issue, the unverified REST certificate, needs
a decision and stays open.

Refs #17
2026-11-01 21:44:52 +01:00
christianmanivong 58428042f1 Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#20) from chore/python-312-floor into main
driver / standard (push) Successful in 15s
driver / lint (push) Successful in 12s
driver / types (push) Successful in 1m0s
driver / test (3.12) (push) Successful in 58s
driver / test (3.13) (push) Successful in 49s
driver / lowest (push) Successful in 25s
driver / build (push) Successful in 27s
driver / security (push) Successful in 1m0s
CI / driver (push) Successful in 2m22s
driver / publish (push) Skipped
2026-10-27 11:35:11 +00:00
Christian Manivong e5173e9b58 fix: the floor on urllib3 is 1.26.5 (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m0s
driver / test (3.12) (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 22s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 55s
CI / driver (pull_request) Successful in 2m19s
driver / publish (pull_request) Skipped
urllib3 1.26.4 and older bundle a six whose import hook Python 3.12 no
longer supports (urllib3.packages.six.moves), so the lowest job failed.
2026-10-27 12:22:15 +01:00
Christian Manivong 4de1c2b2d9 fix: the floor on napalm is 5.1 (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 1m0s
driver / test (3.12) (pull_request) Successful in 56s
driver / test (3.13) (pull_request) Successful in 54s
driver / lowest (pull_request) Failing after 23s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Failing after 2m21s
driver / publish (pull_request) Skipped
napalm 5.0 and older import pkg_resources, which a Python 3.12 venv no
longer has, so the lowest job failed on them.
2026-10-27 10:49:28 +01:00
Christian Manivong 15244c59e6 chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 55s
driver / test (3.12) (pull_request) Successful in 56s
driver / test (3.13) (pull_request) Successful in 49s
driver / lowest (pull_request) Failing after 26s
driver / build (pull_request) Failing after 7s
driver / security (pull_request) Successful in 1m6s
CI / driver (pull_request) Failing after 4m0s
driver / publish (pull_request) Skipped
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
2026-10-27 10:18:56 +01:00
christianmanivong b842aa5763 Merge pull request 'chore: adopt the NAPALM driver standard' (#19) from chore/driver-standard into main
driver / standard (push) Successful in 14s
driver / lint (push) Successful in 12s
driver / types (push) Successful in 47s
driver / test (3.10) (push) Successful in 46s
driver / test (3.11) (push) Successful in 44s
driver / test (3.12) (push) Successful in 45s
driver / test (3.13) (push) Successful in 37s
driver / lowest (push) Successful in 23s
driver / security (push) Successful in 46s
driver / build (push) Successful in 22s
driver / publish (push) Successful in 25s
CI / driver (push) Successful in 55m51s
v0.6.0
2026-10-23 09:46:46 +00:00
Christian Manivong 1a7cf93709 chore(release): 0.6.0
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 46s
driver / test (3.10) (pull_request) Successful in 52s
driver / test (3.11) (pull_request) Successful in 54s
driver / test (3.12) (pull_request) Successful in 47s
driver / test (3.13) (pull_request) Successful in 40s
driver / lowest (pull_request) Successful in 24s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 5m59s
driver / publish (pull_request) Skipped
2026-10-23 10:29:03 +02:00
Christian Manivong 779b42c193 chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 44s
driver / test (3.10) (pull_request) Successful in 45s
driver / test (3.11) (pull_request) Successful in 44s
driver / test (3.12) (pull_request) Successful in 43s
driver / test (3.13) (pull_request) Successful in 37s
driver / lowest (pull_request) Successful in 22s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 5m28s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ goes.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE file,
  CHANGELOG, py.typed, SPDX license string, links to git.netork.io;
  napalm-device-types >=4.21.1, a dev extra with floors.
- [tool.napalm-standard] names the import package napalm_procurve, which is
  not the distribution name.
- True floors for netaddr (>=0.7.10) and urllib3 (>=1.23): unbounded, the
  lowest job installed versions that do not import on Python 3.10.
- mypy strict for the package; napalm_procurve.api_client, .parsers and
  .procurve are exempt for now (136 errors), recorded in the quality
  baseline with their long functions and the 1400-line procurve.py.
  Coverage floor 54 % (measured 54.28 %).
2026-10-23 08:40:11 +02:00
Christian Manivong fc24495b83 fix: what bandit and the remaining lint rules found
- The six except Exception: pass (REST logout, the extra-ports lookup, the
  per-port detail in get_interfaces, closing CLI and REST sessions) now log
  at debug level (B110), so a swallowed failure leaves a trace.
- nosec for comparing a reported address with 0.0.0.0 (B104) and for the
  empty password field of get_users (B105, now a named constant); both are
  false positives.
- A long error message is split into adjacent f-strings; the unused ARP
  entry type is named _entry_type.
- tests: the failed-open test expects ConnectionException instead of any
  Exception; raise ... from exc.
2026-10-23 08:34:55 +02:00
Christian Manivong c2a788fa7a style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
2026-10-23 08:32:50 +02:00
christianmanivong 739283e76b Merge pull request 'fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)' (#16) from fix/ssh-host-key-tofu-1167 into master
CI / test (3.10) (push) Successful in 27s
CI / test (3.11) (push) Successful in 26s
CI / test (3.12) (push) Successful in 29s
2026-10-18 19:23:44 +00:00
Christian Manivong fe0aec9432 fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 37s
CI / test (3.12) (push) Successful in 35s
CI / test (3.10) (pull_request) Successful in 29s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.12) (pull_request) Successful in 28s
The driver accepted any SSH host key. It now verifies through
napalm-device-types' HostKeyCheck (>= 4.19.0): with a known key in
optional_args["ssh_host_keys"] any other key is refused before login, and
every key seen is reported to optional_args["ssh_host_key_observer"].
Without either argument it connects as before (first use).
2026-10-18 21:23:43 +02:00
christianmanivong 382519f780 Merge pull request 'feat!: configure_snmp_agent with the caller's values replaces fix_snmp (0.4.0)' (#15) from feat/snmp-agent-template into master
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 22s
CI / test (3.12) (push) Successful in 25s
2026-10-17 06:48:19 +00:00
Christian Manivong 0527cd20c1 feat!: configure_snmp_agent with the caller's values replaces fix_snmp (0.4.0)
CI / test (3.10) (push) Successful in 24s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 24s
CI / test (3.10) (pull_request) Successful in 24s
CI / test (3.11) (pull_request) Successful in 23s
CI / test (3.12) (pull_request) Successful in 24s
fix_snmp hard-coded community "public". The driver implements
napalm-device-types 4.13's configure_snmp_agent as a whole, because
over REST a temporary SSH session has to run the config-mode CLI:
community (read-only), contact and location from the caller, saved
and verified in show snmp-server. The agent is built in and the switch
filters nothing for its management plane; the steps say so instead of
pretending. A value that would break the CLI is refused.

The unused _detect_management_vlan goes with it.

BREAKING CHANGE: run_device_action is removed.

Part of #12 and #6 (the dead helper).
2026-10-17 08:35:30 +02:00
Christian Manivong 0c0ab7c988 chore: declare napalm-device-types, stop tracking build artefacts
pyproject.toml did not list napalm-device-types although the code
imports it (CI installed it by hand); it now requires 4.13, whose fix
templates the next commit uses. Seven .pyc and six egg-info files were
tracked; they go, and a .gitignore keeps them out.

Closes #11
2026-10-17 08:35:20 +02:00
christianmanivong eeb0340514 Merge pull request 'feat: declare the SNMP health OIDs instead of collecting them (0.3.0)' (#14) from feat/snmp-health-profile into master
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 31s
CI / test (3.12) (push) Successful in 32s
2026-10-16 23:06:58 +00:00
Christian Manivong 39d5e69270 feat: declare the SNMP health OIDs instead of collecting them (0.3.0)
CI / test (3.10) (push) Successful in 31s
CI / test (3.11) (push) Successful in 30s
CI / test (3.12) (push) Successful in 33s
CI / test (3.10) (pull_request) Successful in 33s
CI / test (3.11) (pull_request) Successful in 30s
CI / test (3.12) (pull_request) Successful in 32s
The driver no longer collects over SNMP. SNMP_HEALTH_PROFILE states
where the switch publishes its values; the application polls and
computes (napalm-device-types docs/STRUCTURE.md).

This also fixes the memory figure: NETSWITCH-MIB hpLocalMemEntry column
6 is free memory, not used. On swt-l0-3-40 total 58720256 = free
39105640 + allocated 19614616, so the switch showed 66.6 % used instead
of 33.4 %. The profile names column 6 as free.

Interface counters now come from the 64-bit ifXTable where the switch
has it, as the application reads them for every device.

Closes #9
2026-10-16 12:02:00 +02:00
christianmanivong 03c8f0588d Merge pull request 'ci: run the tests and build the package on every push and pull request' (#7) from ci/workflow into master
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 26s
2026-10-07 06:23:51 +00:00
Christian Manivong b2529d8416 ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 28s
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 30s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.
2026-10-07 07:52:44 +02:00
Christian Manivong 7f07da6857 fix(cli): the trunk gets its own row, as over REST
Since f35b59e a CLI poll reports trunk members as `3` with
trunk_group `Trk3`, but `show interfaces brief` has no line for Trk3
itself, so the trunk was missing from the interface list. The REST path
built that row on its own.

Both paths now use napalm_device_types.add_lag_interfaces, and the REST
path's copy is gone. One visible change there: `lag_members` is now in
port order (7, 10) instead of API order; the description already was.

The CLI path does not know the mode yet, so its trunks carry no
lag_mode. That needs `show trunks`, whose output is not at hand.

Needs napalm-device-types f3fa75b.

Closes #5
2026-09-25 10:44:11 +02:00
Christian Manivong f35b59ec2d fix(cli): read J.15 port status, and say why each transport failed
A 2800-series switch on J.15.09 polled over CLI came back with no
interfaces and an empty OS version, while VLANs and ARP parsed fine.

`show interfaces brief` on that firmware has an Intrusion Alert column
between the `|` and Enabled, and puts Mode before MDI rather than after:

      Port   Type      | Alert     Enabled Status Mode       Mode ...
      3-Trk3 100/1000T | No        Yes     Down   1000FDx    MDI  ...

The regex read Alert as Enabled, then failed on Yes where it wanted
Up|Down, so no line matched. It now skips the Alert column where there is
one and takes the speed from either position. Trunk members are listed as
`<port>-Trk<n>`; the port is `<port>` and the suffix becomes its
trunk_group, so the per-port `show interfaces 3` is a command the switch
knows.

The empty OS version was the alternatives list in _send_command. It moved
to the next command on "% Invalid" or "Error", but ProCurve rejects an
unknown command with "Invalid input: system-information" -- so that line
was parsed as system information. "Invalid input" now counts as failure.

Getting there took longer than it should have, because the first symptom
was "Authentication failed: Login failed". That was Telnet's error, the
last transport tried; the REST probe and both SSH attempts had failed
before it and said nothing above debug level. In fact the switch had run
out of CLI sessions and closed SSH straight after the password. open()
now records why each transport failed, and both the auth error and the
final "Cannot connect" carry that list.

Fixtures are that switch's output, with hostname, serial and MAC
replaced.

Closes #2
Closes #3
Closes #4
2026-09-25 08:55:11 +02:00
Christian Manivong e3bbac0656 fix(api): change an existing VLAN membership instead of re-creating it
set_interface() always POSTed to vlans-ports, treating every membership as
new. Moving a port that already carries the VLAN from untagged to tagged is
not a create, though, and the switch says so:

    POST vlans-ports {"vlan_id":10,"port_id":"10","port_mode":"POM_TAGGED_STATIC"}
      -> 400 {"message":"Association exists"}

Only 409 was handled as "already there"; v7 firmware answers 400. The
membership is its own resource named {vlan_id}-{port_id} and takes a PUT:

    PUT vlans-ports/10-10 -> 200

So the exact case anyone hits first failed outright — a port holding VLAN 10
untagged alongside 30/40/50 tagged, with VLAN 10 to become tagged too.

The response body is now carried into both error messages. The ports PUT just
above already did this; here it was dropped, so "Association exists" — which
names the cause outright — never reached the caller. The message read
"vlans-ports POST HTTP 400" and nothing more.

Verified against a 2530-24G-PoEP on REST v7: set_interface("10", trunk
vlan 30), where that membership already exists, now completes and leaves the
port exactly as it was.
2026-08-18 16:22:21 +07:00
Christian Manivong 0dcede037f fix(deps): pin paramiko>=5.0.0 (CVE-2026-44405) 2026-07-02 12:22:55 +02:00
Christian Manivong 348a62927e fix(get_config): use netmiko hp_procurve on port 22
HP ProCurve needs invoke_shell (not exec_channel) — exec_command via
paramiko returns 'SSH command execution is not supported'. Netmiko's
hp_procurve device type handles this correctly. Port 22 explicit.
2026-06-29 15:51:32 +02:00
Christian Manivong 6e2ac6bd94 fix(get_config): back to paramiko with port 22 — no subprocess needed
Root cause was self.port=443 (REST API port) being used for SSH.
With port 22 paramiko works fine — same as the SSH console link.
2026-06-29 15:44:33 +02:00
Christian Manivong 2bb84aca4f fix(get_config): use port 22 for SSH fallback — self.port is the REST API port
In API transport mode, self.port = 443 (HTTPS). All SSH attempts were
connecting to port 443 which speaks TLS, not SSH — hence 'banner exchange
timed out'. Fix: hardcode port 22 for the SSH config fallback.
2026-06-29 15:37:02 +02:00
Christian Manivong a7ecc6427c fix(get_config): use openssh+sshpass subprocess — bypasses paramiko Mocana compat issue
paramiko 4.x is incompatible with Mocana SSH 6.3 on HP 2530/YA firmware.
OpenSSH subprocess with +diffie-hellman-group1-sha1 kex works correctly
and connects in < 5s instead of hitting the 15s banner timeout.
2026-06-29 15:13:40 +02:00
Christian Manivong fe8df73ad6 fix(get_config): close REST session before SSH fallback
HP ProCurve switches allow only 1 session per user. The REST API session
blocks SSH — closing it before the SSH attempt allows the connection.
_collect_config() is called last so all poll data is already collected.
2026-06-29 15:05:34 +02:00
Christian Manivong a496f02aa9 fix(get_config): use SSHClient.connect() without algorithm overrides
The SSH console link works on this switch using plain paramiko
SSHClient.connect() with no disabled_algorithms and no Transport hacks.
Our previous approaches (Transport._preferred_kex, socket-level timeout)
were breaking the negotiation. Revert to the simple approach that works.
2026-06-29 14:50:34 +02:00
Christian Manivong f7eff4b3ca fix(get_config): socket-level timeout for SSH fallback — covers KEX phase
paramiko banner_timeout/auth_timeout do not cover kex negotiation.
Using raw socket with settimeout(8) ensures the entire SSH handshake
is bounded, preventing the poll from hanging and timing out.
2026-06-29 14:28:21 +02:00
Christian Manivong 831727f2af fix(get_config): use paramiko directly with group1-sha1 for Mocana SSH 6.3
- Replace netmiko with direct paramiko connection for SSH config fallback
- Explicitly set preferred_kex to include diffie-hellman-group1-sha1
  (required by old Mocana SSH 6.3 on HP 2530 / YA firmware)
- Hard timeout caps: banner_timeout=auth_timeout=8s, no keys/agent
2026-06-29 13:53:09 +02:00
Christian Manivong 8a182c4fa4 fix(get_config): cap SSH fallback timeout at 8s to prevent poll timeout
Each SSH attempt was using driver timeout (30s). With 2 attempts that
consumed the entire poll budget → device marked OFFLINE. Now capped at
8s per attempt (max 16s total), well within the 30s poll limit.
2026-06-29 13:42:05 +02:00
Christian Manivong 0d53426636 fix(get_config): try legacy KEX first in SSH fallback for HP 2530/Mocana SSH 2026-06-29 12:54:39 +02:00
Christian Manivong 87db7b2873 fix(get_config): SSH fallback when REST API returns empty (HP 2530/YA firmware)
HP 2530 switches with YA firmware do not expose /rest/v7/running-config.
_get_config_via_ssh() opens a temporary netmiko session to run
'show running-config' as fallback when the API endpoint returns 404.
2026-06-29 12:36:09 +02:00
Christian Manivong 46aadbbe3b fix(get_config): use plain text GET for running/startup config
AOS-Switch returns the config body as text/plain, not JSON.
The previous get_config() called self.get() which calls resp.json(),
silently caught the JSONDecodeError, and returned ''. Now uses _get_text()
which reads resp.text directly.
2026-06-29 12:11:35 +02:00
Christian Manivong d1db7a452d fix: falsche OUI-Prefixes entfernen (gegen IEEE verifiziert) 2026-06-24 17:06:45 +02:00
Christian ManivongandClaude Sonnet 4.6 ef5e453f5d feat: OUI_PREFIXES für MAC/ARP-Fingerprinting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 15:41:45 +02:00
Christian ManivongandClaude Sonnet 4.6 247964178a feat: Fingerprint-Attribute für Discovery-Scoring
Ergänzt DRIVER_NAME, HTTP_FINGERPRINT, SNMP_FINGERPRINT, SSH_FINGERPRINT,
PORT_SPECS und SNMP_OBJECT_ID_PREFIX gemäß docs/DISCOVERY_FINGERPRINTING.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:47:08 +02:00
Christian ManivongandClaude Sonnet 4.6 232936162e fix: try 'show system' as fallback for old ProCurve (no system-information)
Firmware J.15.x (2520G-8-PoE) only supports 'show system', not
'show system-information'. Adding it as the third fallback so serial
number and OS version can still be parsed via parse_system_info().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:46:58 +02:00
Christian ManivongandClaude Sonnet 4.6 55fe8b28f9 fix: search all lines for HP banner, not just first line
Old ProCurve show version starts with "Image stamp:" — the HP product
banner (e.g. "HP J9298A Switch 2520G-8-PoE") appears on a later line.
Scan all lines and use the first HP/HPE/Aruba banner found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:40:44 +02:00
Christian ManivongandClaude Sonnet 4.6 ff37f3c59f fix: only parse HP/Aruba banner lines in parse_model_from_version
Guard against show version outputs that start with "Image stamp:" or
other non-banner lines — return ("", "") when the first line doesn't
begin with HP/HPE/Aruba.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:33:05 +02:00
Christian ManivongandClaude Sonnet 4.6 da5920a9bc fix: parse_model_from_version handles both HP banner orderings
Old switches show: "HP J9298A Switch 2520G-8-PoE" (model after Switch)
Newer switches:    "HP J9565A 2520G-8-PoE Switch" (model before Switch)

New approach: strip vendor prefix + J-code + "Switch" keyword, leaving
just the product name. Returns tuple (model, part_number).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:27:15 +02:00