Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2009 16:35:07 -0500
From:      Stephen Clark <sclark46@earthlink.net>
To:        Peter <fbsdq@peterk.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: FreeBSD 6.3 clear ethernet interface counter
Message-ID:  <4978E68B.20100@earthlink.net>
In-Reply-To: <54994.216.241.167.212.1232652975.squirrel@webmail.pknet.net>
References:  <54994.216.241.167.212.1232652975.squirrel@webmail.pknet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter wrote:
>> Hello,
>>
>> I googled and didn't find an answer on how to clear the interface stats
>> that are
>> displayed by
>> netstat -ibndh
>>
>> could someone point in the right direction?
>>
>> Thanks,
>> Steve
>> --
>>
>> "They that give up essential liberty to obtain temporary safety,
>> deserve neither liberty nor safety."  (Ben Franklin)
>>
>> "The course of history shows that as a government grows, liberty
>> decreases."  (Thomas Jefferson)
> 
> http://www.google.com/search?q=clear+netstat+interface+counters&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
> 
> $man  netstat |grep -B1 -i counter
>              in and out.  If -d is also present, show the number of dropped
>              packets.  If -h is also present, print all counters in human
> --
>              particular protocol_family, or for a single protocol.  If -s is
>              repeated, counters with a value of zero are suppressed.  If
> -z is
>              also present, reset statistic counters after displaying them
> 
Sigh ... you obviously didn't try using the -z option.
[root@sclark ~]# netstat -iz
Name    Mtu Network       Address              Ipkts Ierrs    Opkts Oerrs  Coll
rl0    1500 <Link#1>      00:e0:7d:9b:f7:a3 10187060     0  2681169     0     0
rl0    1500 192.168.198   192.168.198.50     3567132     -  2582751     -     -
rl0    1500 10.254.150/24 10.254.150.10       108113     -    75684     -     -
rl1    1500 <Link#2>      00:e0:7d:9b:f7:9d 18584893     0  9470823     1     0
rl1    1500 10.0.128/17   sclark            11450836     -  9461523     -     -
vr0    1500 <Link#3>      00:11:5b:15:5a:4d     9068     0    18004     0     0
vr0    1500 10.3.1/24     10.3.1.1              9068     -     9068     -     -
plip0  1500 <Link#4>                               0     0        0     0     0
lo0   16384 <Link#5>                         6196166     0  6196166     0     0
lo0   16384 your-net      localhost          6196154     -  6196154     -     -
[root@sclark ~]# netstat -iz
Name    Mtu Network       Address              Ipkts Ierrs    Opkts Oerrs  Coll
rl0    1500 <Link#1>      00:e0:7d:9b:f7:a3 10187069     0  2681171     0     0
rl0    1500 192.168.198   192.168.198.50     3567136     -  2582753     -     -
rl0    1500 10.254.150/24 10.254.150.10       108113     -    75684     -     -
rl1    1500 <Link#2>      00:e0:7d:9b:f7:9d 18584947     0  9470852     1     0
rl1    1500 10.0.128/17   sclark            11450884     -  9461552     -     -
vr0    1500 <Link#3>      00:11:5b:15:5a:4d     9068     0    18004     0     0
vr0    1500 10.3.1/24     10.3.1.1              9068     -     9068     -     -
plip0  1500 <Link#4>                               0     0        0     0     0
lo0   16384 <Link#5>                         6196207     0  6196207     0     0
lo0   16384 your-net      localhost          6196195     -  6196195     -     -

also from the man page:     netstat -i | -I interface [-abdhntW]
  [-f address_family] [-M core] [-N system]
notice no "-z"

-z is for clearing protocol stats.


-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4978E68B.20100>