System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear counters on netstat

jeffunix
Occasional Advisor

How to clear counters on netstat

Hi guys,
Just recently checking the collisions on my unix machine for me to adjust the negotiation. How can i clear the counters i see using the netstat -in command.

tnx

jeff
9 REPLIES
Kapil Jha
Honored Contributor

Re: How to clear counters on netstat

#netstat -I ln0 -z
This would set the ln0 interface counters to zero.

BR,
Kapil
I am in this small bowl, I wane see the real world......
Kapil Jha
Honored Contributor

Re: How to clear counters on netstat

in case of any kind of confusion...
RTFM
:)
BR,
Kapil
I am in this small bowl, I wane see the real world......
jeffunix
Occasional Advisor

Re: How to clear counters on netstat

Hi Kapil,
It doesnt work =), i used this command netstat -I ee0 -z

tia

jeff
Kapil Jha
Honored Contributor

Re: How to clear counters on netstat

which version you are working at???
have you seen
man netstat

6. To set the ln0 interface counters to zero, enter:
# netstat -Iln0 -z
I am pasting lines from man page.
I do not system to check if it is working or not.But I suppose it should.
BR,
Kapil
I am in this small bowl, I wane see the real world......
jeffunix
Occasional Advisor

Re: How to clear counters on netstat

im using V5.1
Kapil Jha
Honored Contributor

Re: How to clear counters on netstat

5.1A or 5.1B
anyways whats the error it through.
Kapil
I am in this small bowl, I wane see the real world......
Rob Leadbeater
Honored Contributor

Re: How to clear counters on netstat

Hi Jeff,

According to the 5.1 netstat man page here:

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0253____.HTM

The command to reset interface ee0 would be:

# netstat -z -I ee0

Although the example (given earlier) does have the arguments the -z and -I arguments the other way round...

When it "doesn't work" what does it do ?

Cheers,

Rob
jeffunix
Occasional Advisor

Re: How to clear counters on netstat

Hi guys,
I want to clear the counters on the Opkts, Oerrs and Coll when using the netstat -ni. Using that command doesnt zero in the counters.

tnx in advance.

jeff
Steven Schweda
Honored Contributor

Re: How to clear counters on netstat

> I want to clear the counters on the Opkts,
> Oerrs and Coll when using the netstat -ni.
> Using that command doesnt zero in the
> counters.

Apparently (and consistent with "man
netstat"), "-z" clears the counters in the
"-s" report (which it also shows):

urtx# netstat -I tu0 -z

tu0 Ethernet counters at Tue Dec 11 03:28:03 2007

388 seconds since last zeroed
33009 bytes received
17839 bytes sent
458 data blocks received
65 data blocks sent
28785 multicast bytes received
392 multicast blocks received
1095 multicast bytes sent
9 multicast blocks sent
0 blocks sent, initially deferred
0 blocks sent, single collision
0 blocks sent, multiple collisions
0 send failures
0 receive failures

urtx# netstat -I tu0 -s

tu0 Ethernet counters at Tue Dec 11 03:28:07 2007

4 seconds since last zeroed
896 bytes received
994 bytes sent
14 data blocks received
6 data blocks sent
192 multicast bytes received
3 multicast blocks received
0 multicast bytes sent
0 multicast blocks sent
0 blocks sent, initially deferred
0 blocks sent, single collision
0 blocks sent, multiple collisions
0 send failures
0 receive failures


It seems to have no effect on the counts
shown in the plain "-i" (or "-I") report.

If there's a simple, convenient way to do
what you want, I don't know about it.

Around here (V5.1B-4):

urtx# sizer -v
HP Tru64 UNIX V5.1B (Rev. 2650); Mon Feb 19 11:57:07 CST 2007