Bug 251103 - net-mgmt/net-snmp: memory patch lost after 5.7 to 5.9 upgrade
Summary: net-mgmt/net-snmp: memory patch lost after 5.7 to 5.9 upgrade
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-13 16:43 UTC by ncrogers
Modified: 2020-11-16 18:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (zi)


Attachments
Add back patch-agent_mibgroup_hardware_memory_memory__freebsd.c. (1.04 KB, patch)
2020-11-13 16:43 UTC, ncrogers
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ncrogers 2020-11-13 16:43:37 UTC
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.
Comment 1 ncrogers 2020-11-13 16:50:56 UTC
Here is a related request to the net-snmp project.

https://github.com/net-snmp/net-snmp/issues/205
Comment 2 Ryan Steinmetz freebsd_committer freebsd_triage 2020-11-13 17:14:40 UTC
Can you open a PR with the devs and include your patch so it gets upstreamed?
Comment 3 ncrogers 2020-11-13 17:49:20 UTC
Yeah, I just opened PR with the patch.
https://github.com/net-snmp/net-snmp/pull/206
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-11-15 16:28:02 UTC
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
Comment 5 ncrogers 2020-11-16 18:56:09 UTC
Thank you. net-snmp also accepted the patch upstream, so the patch file can be safely removed the next time the port is upgraded.