Created attachment 219637 [details] Add back patch-agent_mibgroup_hardware_memory_memory__freebsd.c. In the upgrade from 5.7.3 to 5.9, the following MIB patch was removed: patch-agent_mibgroup_hardware_memory_memory__freebsd.c. This patch is, unfortunately, still necessary to correctly instrument "used" and "free" memory via SNMP under FreeBSD, since "inactive" memory needs to be reported along with "cache" in the "UCD-SNMP-MIB::memCached" OID. This change was never upstreamed to net-snmp. This issue is a repeat of the old PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=148339 I've attached a patch that includes the old patch, which still applies cleanly. As an aside, I'm not sure if "Laundry" memory needs to be reported in this MIB or not as well? Can someone with more insight comment on this? Currently I am using (memTotalReal - memAvailReal - memCached) to instrument "used" memory via SNMP.
Here is a related request to the net-snmp project. https://github.com/net-snmp/net-snmp/issues/205
Can you open a PR with the devs and include your patch so it gets upstreamed?
Yeah, I just opened PR with the patch. https://github.com/net-snmp/net-snmp/pull/206
A commit references this bug: Author: zi Date: Sun Nov 15 16:27:34 UTC 2020 New revision: 555237 URL: https://svnweb.freebsd.org/changeset/ports/555237 Log: - Add memory calculation fix - Bump PORTREVISION PR: 251103 Submitted by: ncrogers@gmail.com Changes: head/net-mgmt/net-snmp/Makefile head/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
Thank you. net-snmp also accepted the patch upstream, so the patch file can be safely removed the next time the port is upgraded.