Bug 123276 - net-mgmt/net-snmp: net-snmp54 reports wrong hrMemorySize
Summary: net-mgmt/net-snmp: net-snmp54 reports wrong hrMemorySize
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jun Kuriyama
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-30 19:40 UTC by Helmut Schneider
Modified: 2008-07-03 14:40 UTC (History)
0 users

See Also:


Attachments
net-snmp.patch (662 bytes, patch)
2008-06-29 08:35 UTC, valerio.daelli
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Schneider 2008-04-30 19:40:01 UTC
[root@BSDHelmut ~]# snmpwalk -v2c -cpublic localhost HOST-RESOURCES-MIB::hrMemorySize.0
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 3191524 KBytes
[root@BSDHelmut ~]# snmpwalk -v2c -cpublic localhost HOST-RESOURCES-MIB::hrMemorySize.0
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 3189804 KBytes
[root@BSDHelmut ~]#

IMO HOST-RESOURCES-MIB::hrMemorySize.0 should be unchanging.

[root@BSDHelmut ~]# sysctl hw.physmem
hw.physmem: 3476221952
[root@BSDHelmut ~]#

[root@BSDHelmut ~]# pkg_info | grep net-snmp
net-snmp-5.4.1_3    An extendable SNMP implementation
[root@BSDHelmut ~]#

Here is what net-snmp53 says:

[root@BSDHelmut ~]# snmpwalk -v2c -cpublic localhost HOST-RESOURCES-MIB::hrMemorySize.0
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 3394748 KBytes
[root@BSDHelmut ~]#

3394748*1024=3476221952 => correct.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-04-30 22:19:16 UTC
Responsible Changed
From-To: freebsd-bugs->kuriyama

Make this a ports PR and assign.
Comment 2 valerio.daelli 2008-06-29 08:35:57 UTC
Hi

I have a patch that may solve this (I have attached it).
Comment 3 Valerio Daelli 2008-06-29 10:24:57 UTC
>Description:

My first patch got screwed.
Hope this goes better.
	
>How-To-Repeat:
	
>Fix:

--- net-snmp.patch begins here ---
diff -ruN net-snmp.old/work/net-snmp-5.4.1/agent/mibgroup/hardware/memory/memory_freebsd.c net-snmp/work/net-snmp-5.4.1/agent/mibgroup/hardware/memory/memory_freebsd.c
--- net-snmp.old/work/net-snmp-5.4.1/agent/mibgroup/hardware/memory/memory_freebsd.c	2008-06-29 09:03:45.000000000 +0200
+++ net-snmp/work/net-snmp-5.4.1/agent/mibgroup/hardware/memory/memory_freebsd.c	2008-06-29 09:20:25.000000000 +0200
@@ -74,7 +74,7 @@
         if (!mem->descr)
              mem->descr = strdup("Physical memory");
         mem->units = pagesize;
-        mem->size  = user_mem/pagesize;
+        mem->size  = phys_mem/pagesize;
         mem->free  = total.t_free;
     }
 
--- net-snmp.patch ends here ---
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-07-03 14:35:31 UTC
kuriyama    2008-07-03 13:35:20 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt/net-snmp    Makefile distinfo 
    net-mgmt/net-snmp/files patch-memory_freebsd.c 
  Log:
  - Upgrade to 5.4.1.2.
  - Fix hrMemorySize.0 MIB value [1].
  
  Submitted by:   Helmut Schneider <jumper99@gmx.de> [1]
  PR:             ports/123276 [1]
  
  Revision  Changes    Path
  1.156     +1 -2      ports/net-mgmt/net-snmp/Makefile
  1.36      +3 -3      ports/net-mgmt/net-snmp/distinfo
  1.2       +11 -2     ports/net-mgmt/net-snmp/files/patch-memory_freebsd.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Jun Kuriyama freebsd_committer freebsd_triage 2008-07-03 14:35:36 UTC
State Changed
From-To: open->closed

Sorry late.  Committed, thanks!