1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

- Fix problem with memCached incorrect. [2]

- BUMP PORTREVISION

PR:		ports/147468
Submitted by:	Helmut Schneider <jumper99@gmx.de>
	 	Y.A. <nexther0@gmail.com> [2]
Feature safe:	yes
This commit is contained in:
Sylvio Cesar Teixeira 2010-06-28 14:51:46 +00:00
parent 32fece5a6d
commit f068486d4c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=257111
2 changed files with 34 additions and 22 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= snmp
PORTVERSION= 5.5
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= net-mgmt ipv6
MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION}
PKGNAMEPREFIX= net-

View File

@ -1,14 +1,31 @@
--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2008-05-28 20:48:46.000000000 +0900
+++ agent/mibgroup/hardware/memory/memory_freebsd.c 2008-11-14 16:56:48.000000000 +0900
@@ -59,6 +59,7 @@
--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2008-05-28 14:48:46.000000000 +0300
+++ agent/mibgroup/hardware/memory/memory_freebsd.c 2010-06-27 15:19:27.000000000 +0300
@@ -43,9 +43,12 @@
u_long phys_mem;
u_long user_mem;
+ unsigned int cache_count;
+ unsigned int cache_max;
unsigned int bufspace;
unsigned int maxbufspace;
size_t mem_size = sizeof(phys_mem);
+ size_t cache_size = sizeof(cache_count);
size_t buf_size = sizeof(bufspace);
int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
int user_mem_mib[] = { CTL_HW, HW_USERMEM };
@@ -56,9 +59,10 @@
sysctl(total_mib, 2, &total, &total_size, NULL, 0);
sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0);
sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_cache_count", &cache_count, &cache_size, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_cache_max", &cache_max, &cache_size, NULL, 0);
sysctlbyname("vfs.bufspace", &bufspace, &buf_size, NULL, 0);
sysctlbyname("vfs.maxbufspace", &maxbufspace, &buf_size, NULL, 0);
auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem));
+ auto_nlist(BUFSPACE_SYMBOL, (char *) &bufspace, sizeof(bufspace));
- auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem));
#ifndef freebsd4
pagesize = 1024;
#else
@@ -75,7 +76,7 @@
@@ -75,7 +79,7 @@
if (!mem->descr)
mem->descr = strdup("Physical memory");
mem->units = pagesize;
@ -17,21 +34,16 @@
mem->free = total.t_free;
}
@@ -134,6 +135,17 @@
mem->free = vmem.v_cache_max - vmem.v_cache_count;
@@ -129,9 +133,9 @@
} else {
if (!mem->descr)
mem->descr = strdup("Cached memory");
- mem->units = vmem.v_page_size;
- mem->size = vmem.v_cache_max;
- mem->free = vmem.v_cache_max - vmem.v_cache_count;
+ mem->units = pagesize;
+ mem->size = cache_max;
+ mem->free = cache_max - cache_count;
}
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 );
+ if (!mem) {
+ snmp_log_perror("No Memory Buffer info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Memory Buffer");
+ mem->units = pagesize;
+ mem->size = bufspace/pagesize;
+ mem->free = -1;
+ }
+
nswap = swapmode(pagesize);
mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
if (!mem) {