OpenBSD: net-snmp reports 0 % idle, so netOrk shows the host at 100 % CPU #7

Open
opened 2026-10-08 12:31:28 +00:00 by christianmanivong · 0 comments
Owner

Found while building SNMP for the BSDs (NetOrk/netork#800), on OpenBSD 7.9 with net-snmp from packages, set up by run_device_action("fix_snmp").

What happens. On an idle VM, net-snmp answers ssCpuIdle (UCD-SNMP-MIB, 1.3.6.1.4.1.2021.11.11.0) with 0. The raw CPU counters (ssCpuRaw*) are wrong too, and so is hrProcessorLoad (100). net-snmp appears to map OpenBSD's kernel CPU states wrongly.

Why it shows in netOrk. OpenBSDDriver gets its health metrics from napalm-device-types' HealthMetricsMixin (through OSDriver), which computes cpu_percent = 100 - ssCpuIdle. Every OpenBSD host with SNMP set up therefore reports 100 % CPU, and netOrk's CPU thresholds and charts follow from that. This already applies to an OpenBSD host added by hand: the driver is pinned on netOrk's main since NetOrk/netork#826. It is not limited to provisioned VMs, which wait for NetOrk/netork#797.

On FreeBSD 15.1 the same OIDs are right, once the agent has been running for about a minute.

Options. Not decided yet.

  1. OpenBSDDriver leaves cpu_percent out of its health metrics, so netOrk shows CPU as unknown rather than wrong. Memory, swap and load are correct on OpenBSD and stay. This is a driver-side override, or a class attribute in HealthMetricsMixin if more drivers need it.
  2. Find out whether a newer net-snmp or a different OID reads OpenBSD's CPU correctly. This first needs a check against sysctl kern.cp_time on the host.

Memory buffers and cache (memBuffer, memCached) are not provided on OpenBSD either. That is not a wrong value: netOrk just has no figure for them.

Found while building SNMP for the BSDs (NetOrk/netork#800), on OpenBSD 7.9 with net-snmp from packages, set up by `run_device_action("fix_snmp")`. **What happens.** On an idle VM, net-snmp answers `ssCpuIdle` (UCD-SNMP-MIB, `1.3.6.1.4.1.2021.11.11.0`) with 0. The raw CPU counters (`ssCpuRaw*`) are wrong too, and so is `hrProcessorLoad` (100). net-snmp appears to map OpenBSD's kernel CPU states wrongly. **Why it shows in netOrk.** `OpenBSDDriver` gets its health metrics from napalm-device-types' `HealthMetricsMixin` (through `OSDriver`), which computes `cpu_percent = 100 - ssCpuIdle`. Every OpenBSD host with SNMP set up therefore reports 100 % CPU, and netOrk's CPU thresholds and charts follow from that. This already applies to an OpenBSD host added by hand: the driver is pinned on netOrk's main since NetOrk/netork#826. It is not limited to provisioned VMs, which wait for NetOrk/netork#797. On FreeBSD 15.1 the same OIDs are right, once the agent has been running for about a minute. **Options.** Not decided yet. 1. `OpenBSDDriver` leaves `cpu_percent` out of its health metrics, so netOrk shows CPU as unknown rather than wrong. Memory, swap and load are correct on OpenBSD and stay. This is a driver-side override, or a class attribute in `HealthMetricsMixin` if more drivers need it. 2. Find out whether a newer net-snmp or a different OID reads OpenBSD's CPU correctly. This first needs a check against `sysctl kern.cp_time` on the host. Memory buffers and cache (`memBuffer`, `memCached`) are not provided on OpenBSD either. That is not a wrong value: netOrk just has no figure for them.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-bsd#7