mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
o Fix regression in 5.4.1 - the custom FreeBSD vmstat code is not compiled
in making number of popular OIDs unavailable. o Fix issue with retrieving CPU stats in 6.3-STABLE and upper. The problem is that the cp_time symbol is no longer avaliable in the nevest kernels. Use kern.cp_time sysctl which has been around for 8 years or so, so that it should be present virtually in every FreeBSD version that is able to use modern ports tree (4.x and upper). Sysctl is also better from the security standpoint, as you don't need elevated privileges to get the data. One should probably look at converting few others uses of KVM here, but ENOTIME from me. The patch has been submitted to the vendor. Sponsored by: Sippy Software, Inc., http://www.sippysoft.com Approved by: MAINTAINER
This commit is contained in:
parent
c7f302cd98
commit
c1830a37f8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=212187
6 changed files with 78 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= snmp
|
||||
PORTVERSION= 5.4.1
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= net-mgmt ipv6
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= net-snmp
|
||||
|
|
16
net-mgmt/net-snmp-devel/files/patch-ucd_snmp.h
Normal file
16
net-mgmt/net-snmp-devel/files/patch-ucd_snmp.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
$FreeBSD$
|
||||
|
||||
--- agent/mibgroup/ucd_snmp.h.orig
|
||||
+++ agent/mibgroup/ucd_snmp.h
|
||||
@@ -13,5 +13,10 @@
|
||||
config_require(ucd-snmp/logmatch)
|
||||
config_require(ucd-snmp/memory)
|
||||
config_require(ucd-snmp/vmstat)
|
||||
+config_arch_require(freebsd4, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd5, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd6, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd7, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd8, ucd-snmp/vmstat_freebsd2)
|
||||
config_add_mib(UCD-SNMP-MIB)
|
||||
config_add_mib(UCD-DEMO-MIB)
|
22
net-mgmt/net-snmp-devel/files/patch-vmstat_freebsd2.c
Normal file
22
net-mgmt/net-snmp-devel/files/patch-vmstat_freebsd2.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig 2008-04-25 16:28:53.000000000 +0300
|
||||
+++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c 2008-04-25 16:29:01.000000000 +0300
|
||||
@@ -174,6 +174,7 @@
|
||||
static long cpu_total;
|
||||
long cpu_sum;
|
||||
double cpu_prc;
|
||||
+ int mib[2], mib_len, cpu_new_len;
|
||||
|
||||
static struct vmmeter mem_old, mem_new;
|
||||
|
||||
@@ -195,7 +196,10 @@
|
||||
/*
|
||||
* CPU usage
|
||||
*/
|
||||
- auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
|
||||
+ mib_len = 2;
|
||||
+ sysctlnametomib("kern.cp_time", mib, &mib_len);
|
||||
+ cpu_new_len = sizeof(cpu_new);
|
||||
+ sysctl(mib, mib_len, cpu_new, &cpu_new_len, NULL, 0);
|
||||
|
||||
cpu_total = 0;
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= snmp
|
||||
PORTVERSION= 5.4.1
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= net-mgmt ipv6
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= net-snmp
|
||||
|
|
16
net-mgmt/net-snmp/files/patch-ucd_snmp.h
Normal file
16
net-mgmt/net-snmp/files/patch-ucd_snmp.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
$FreeBSD$
|
||||
|
||||
--- agent/mibgroup/ucd_snmp.h.orig
|
||||
+++ agent/mibgroup/ucd_snmp.h
|
||||
@@ -13,5 +13,10 @@
|
||||
config_require(ucd-snmp/logmatch)
|
||||
config_require(ucd-snmp/memory)
|
||||
config_require(ucd-snmp/vmstat)
|
||||
+config_arch_require(freebsd4, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd5, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd6, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd7, ucd-snmp/vmstat_freebsd2)
|
||||
+config_arch_require(freebsd8, ucd-snmp/vmstat_freebsd2)
|
||||
config_add_mib(UCD-SNMP-MIB)
|
||||
config_add_mib(UCD-DEMO-MIB)
|
22
net-mgmt/net-snmp/files/patch-vmstat_freebsd2.c
Normal file
22
net-mgmt/net-snmp/files/patch-vmstat_freebsd2.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig 2008-04-25 16:28:53.000000000 +0300
|
||||
+++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c 2008-04-25 16:29:01.000000000 +0300
|
||||
@@ -174,6 +174,7 @@
|
||||
static long cpu_total;
|
||||
long cpu_sum;
|
||||
double cpu_prc;
|
||||
+ int mib[2], mib_len, cpu_new_len;
|
||||
|
||||
static struct vmmeter mem_old, mem_new;
|
||||
|
||||
@@ -195,7 +196,10 @@
|
||||
/*
|
||||
* CPU usage
|
||||
*/
|
||||
- auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
|
||||
+ mib_len = 2;
|
||||
+ sysctlnametomib("kern.cp_time", mib, &mib_len);
|
||||
+ cpu_new_len = sizeof(cpu_new);
|
||||
+ sysctl(mib, mib_len, cpu_new, &cpu_new_len, NULL, 0);
|
||||
|
||||
cpu_total = 0;
|
||||
|
Loading…
Add table
Reference in a new issue