fix: the SNMP agent setup sends only what os-net-snmp 26.x knows (#36) #37

Merged
christianmanivong merged 2 commits from fix/snmp-agent-26x into main 2026-11-01 06:29:29 +00:00
Owner

configure_snmp_agent() failed on OPNsense 26.x with HTTP 500 at the configure step: general/set named fields the os-net-snmp model does not have (contact, location, sysobjid, bindip) and sent listen in the shape get returns.

  • Only fields the model has: enabled, community, listen (a string; "" for a DNS name, which means every address, as before), and syscontact/syslocation.
  • Contact and location only when the caller gives them. Sending "" would have blanked what the operator set.
  • The test API now refuses an unknown field or a non-string value with a 500, as 26.x does. Its settings are the shape a 26.7 box serves.

Closes #36

`configure_snmp_agent()` failed on OPNsense 26.x with HTTP 500 at the configure step: `general/set` named fields the os-net-snmp model does not have (`contact`, `location`, `sysobjid`, `bindip`) and sent `listen` in the shape `get` returns. - Only fields the model has: `enabled`, `community`, `listen` (a string; `""` for a DNS name, which means every address, as before), and `syscontact`/`syslocation`. - Contact and location only when the caller gives them. Sending `""` would have blanked what the operator set. - The test API now refuses an unknown field or a non-string value with a 500, as 26.x does. Its settings are the shape a 26.7 box serves. Closes #36
christianmanivong added 1 commit 2026-10-31 06:17:14 +00:00
fix: the SNMP agent setup sends only what os-net-snmp 26.x knows (#36)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Failing after 16s
driver / types (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Failing after 2m15s
driver / publish (pull_request) Skipped
8bf76aa346
The configure step posted contact, location, sysobjid and bindip, and
listen in the shape get returns. OPNsense 26.x refuses a field its model
does not have with HTTP 500, so the setup failed on every current box.
It now sends syscontact/syslocation, listen as a string, and contact and
location only when the caller gives them: an empty one would have blanked
the operator's.
christianmanivong added 1 commit 2026-11-01 06:25:49 +00:00
refactor: the SNMP agent config step keeps under the complexity ratchet (#36)
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m22s
driver / test (3.13) (pull_request) Successful in 1m18s
driver / lowest (pull_request) Successful in 34s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 55s
CI / driver (pull_request) Successful in 55s
driver / publish (pull_request) Skipped
0bb59b60a0
_write_snmp_agent_config came out at complexity 11 and failed the
standard job. The community check and the listen address now live in
their own helpers; the baseline follows the file's new length.
christianmanivong merged commit e2cac52a12 into main 2026-11-01 06:29:29 +00:00
christianmanivong deleted branch fix/snmp-agent-26x 2026-11-01 06:29:29 +00:00
Sign in to join this conversation.