fix: REST side session port, connect reasons, SNMP config over REST (#17, #13, #10) #21

Merged
christianmanivong merged 5 commits from fix/bugs-2026-11 into main 2026-11-01 22:00:20 +00:00
5 Commits
Author SHA1 Message Date
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