Date: Thu, 25 Sep 2008 10:52:07 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: "Vonarburg, David" <vonarburg@omnisec.ch> Cc: Erik Osterholm <freebsd-lists-erik@erikosterholm.org>, freebsd-questions@freebsd.org Subject: Re: AW: ethernet statistics Message-ID: <20080925155203.GB3284@dan.emsphone.com> In-Reply-To: <A1BAB23919F569438AECF5587963BC2513BB62@mailserver2.omnisec.ch> References: <A1BAB23919F569438AECF5587963BC2513BB62@mailserver2.omnisec.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Sep 25), Vonarburg, David said: > netstat -i is ok for a user to get system statictics. I'd like get > exactly this information but as a function call inside a "C" language > application netstat -i still digs into kernel memory to get those stats, I think, so you can't directly access those numbers as a regular user. You can shell out and parse the output of "netstat -i", or do some snmp queries to your local net-snmp daemon. Checking the dev.em.0.stats sysctl node is another option, and gives you some more hardware status counters than netstat, but not all drivers support it (em does so you're okay). -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080925155203.GB3284>