Subject: Re: vmstat and netstat....
To: None <tech-kern@NetBSD.org>
From: Pavel Cahyna <pavel.cahyna@st.mff.cuni.cz>
List: tech-kern
Date: 03/27/2006 10:39:03
On Mon, Mar 27, 2006 at 10:14:53AM +0200, Manuel Bouyer wrote:
> On Sun, Mar 26, 2006 at 11:16:37PM -0800, Garrett D'Amore wrote:
> > It was recently pointed out that a few commands (vmstat, netstat)
> > require a kernel file (/netbsd) in the root filesystem in order to
> > provide, for example, accurate statistics.
> 
> Are you sure ? Can you give examples ? AFAIK these commands uses
> sysctl to get the statistics on live systems, /netbsd (or the kernel
> binary specified by -N) is used only when working on crashdumps.

Even in cases where they don't use sysctl, they are able to use
/dev/ksyms instead of /netbsd.

# rm /netbsd
# vmstat -m
<sensible output>
# mv /dev/ksyms /dev/ksyms.bak
# vmstat -m                    
vmstat: kvm_openfiles: /netbsd: No such file or directory

Pavel