$OpenBSD: patch-agent_mibgroup_hardware_cpu_cpu_sysctl_c,v 1.6 2014/12/09 15:20:06 sthen Exp $ swapins/swapouts were removed from struct uvmexp in uvm_extern.h 1.105 --- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig Tue Feb 25 20:50:16 2014 +++ agent/mibgroup/hardware/cpu/cpu_sysctl.c Thu Mar 20 12:52:45 2014 @@ -127,6 +127,10 @@ void init_cpu_sysctl( void ) { #else /* VM_UVMEXP */ /* OpenBSD 3+, NetBSD 1.6+ */ #define NETSNMP_VM_STATS VM_UVMEXP #define NETSNMP_VM_STATS_TYPE struct uvmexp +#if defined(openbsd5) + #undef NS_VM_SWAPIN + #undef NS_VM_SWAPOUT +#endif /* openbsd5 */ #endif /* VM_UVMEXP2 || VM_UVMEXP */ #elif defined(__FreeBSD__) /* FreeBSD */ @@ -209,8 +213,12 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0); cpu->nInterrupts = mem_stats.NS_VM_INTR; cpu->nCtxSwitches = mem_stats.NS_VM_SWTCH; +#ifdef NS_VM_SWAPIN cpu->swapIn = mem_stats.NS_VM_SWAPIN; +#endif +#ifdef NS_VM_SWAPOUT cpu->swapOut = mem_stats.NS_VM_SWAPOUT; +#endif #ifdef NS_VM_PAGEIN cpu->pageIn = mem_stats.NS_VM_PAGEIN; #endif @@ -270,8 +278,12 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void */ cpu->nInterrupts = mem_stats.NS_VM_INTR; cpu->nCtxSwitches = mem_stats.NS_VM_SWTCH; +#ifdef NS_VM_SWAPIN cpu->swapIn = mem_stats.NS_VM_SWAPIN; +#endif +#ifdef NS_VM_SWAPOUT cpu->swapOut = mem_stats.NS_VM_SWAPOUT; +#endif #ifdef NS_VM_PAGEIN cpu->pageIn = mem_stats.NS_VM_PAGEIN; #endif