> I am trying to get network interface statistcs from the kernel
> similar to those obtained by "netstat -i"... basically, I am writing
> a small monitoring program and want to get the stats myself rather
> than parse netstat output.
Evidently these statistics are part of the kstat facility.
An interface's statistics may be obtained via the network interface
name symbol (e.g., le0) -- a pointer to name/value pairs for
various statistics are returned. "top" has the means (C) for extracting
such statistcs (as described in the kstat man page).
------
Alternatively, the SE Toolkit could be used
(as mentioned by several people -- thanks):
As Michael Shon put it:
"For freeware, try the SE toolkit written by 2 of Sun's major
performance gurus.
http://www.sun.com/950901/columns/adrian/se2.4.html
It is an interpreted C-like language with hooks for reading kernel
data structures directly. Includes many sample programs which will
either do almost what you want, or at least show you how to do it."
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:42 CDT