AW: ethernet statistics

2008-09-25 Thread Vonarburg, David
Hi,
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
David

-Ursprüngliche Nachricht-
Von: Erik Osterholm [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 25. September 2008 17:24
An: Vonarburg, David
Cc: freebsd-questions@freebsd.org
Betreff: Re: ethernet statistics

On Thu, Sep 25, 2008 at 04:39:35PM +0200, Vonarburg, David wrote:
 Hi,
 I am using Intel PRO/1000PT Server adaptor with freeBSD 7.0.
 How can I read out the statistics of the card from software?
 (num bytes received, packets sent and more)
 
 Thanks in advance
 David

Is netstat -i what you're looking for?

Erik
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: AW: ethernet statistics

2008-09-25 Thread Dan Nelson
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
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: AW: ethernet statistics

2008-09-25 Thread Mel
On Thursday 25 September 2008 17:52:07 Dan Nelson wrote:
 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.

All those vars are available through sysctl. For an example, look in 
src/in_sysctl.c from net/bmon port. 

-- 
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]