Operating System - HP-UX
1819791 Members
3300 Online
109607 Solutions
New Discussion юеВ

how to clear 'netstat -p tcp' stats

 
Bob_Vance
Esteemed Contributor

how to clear 'netstat -p tcp' stats

Anybody know how to clear the stats from
netstat -p tcp
?
There are a lot of timeouts, queue fulls, etc, but the server has been up for 9 days.
Also, don't want to reboot (production).

jaguar ## netstat -p tcp
... tcp:
... 247891245 packets sent
... 220547002 data packets (739136950 bytes)
... 7851 data packets (7983180 bytes) retransmitted
... 27328851 ack-only packets (4308486 delayed)
... 45 URG only packets
... 8262 window probe packets
... 13525 window update packets
... 5049605 control packets
... 257420195 packets received
... 195107918 acks (for 733873474 bytes)
... 2366455 duplicate acks
... 0 acks for unsent data
... 226476131 packets (4180944563 bytes) received in-sequence
... 0 completely duplicate packets (0 bytes)
... 169 packets with some dup, data (85007 bytes duped)
... 2382 out of order packets (4622967 bytes)
... 0 packets (0 bytes) of data after window
... 26278 window probes
... 57988772 window update packets
... 26423 packets received after close
... 2 segments discarded for bad checksum
... 0 bad TCP segments dropped due to state change
... 928235 connection requests
... 1658802 connection accepts
... 2587037 connections established (including accepts)
... 2814064 connections closed (including 227338 drops)
... 199745 embryonic connections dropped
... 192710322 segments updated rtt (of 192710322 attempts)
... 13234 retransmit timeouts
... 225 connections dropped by rexmit timeout
... 8262 persist timeouts
... 35807 keepalive timeouts
... 35422 keepalive probes sent
... 0 connections dropped by keepalive
... 10114 connect requests dropped due to full queue
... 27551 connect requests dropped due to no listener


tks
bv
"The lyf so short, the craft so long to lerne." - Chaucer
8 REPLIES 8
Bob_Vance
Esteemed Contributor

Re: how to clear 'netstat -p tcp' stats

Oh, yeah.

hpux 11.00


tks
bv
"The lyf so short, the craft so long to lerne." - Chaucer
Devesh Pant_1
Esteemed Contributor

Re: how to clear 'netstat -p tcp' stats

BV,
I think the only way out is a reboot.

DP
Bob_Vance
Esteemed Contributor

Re: how to clear 'netstat -p tcp' stats

Thanks, Devesh.
It's looking that way.
But I'd think that at least they would be held in kernel mem counters somewhere that an 'adb' could clear.

bv
"The lyf so short, the craft so long to lerne." - Chaucer
Rajesh SB
Esteemed Contributor

Re: how to clear 'netstat -p tcp' stats

Hi,

You can trace the services used by ports by utility "lsof" and you can try to release the ports by clearing respective process/service.

lsof can be find at
http://hpux.connect.org.uk

Cheers,
Rajesh
Uday_S_Ankolekar
Honored Contributor

Re: how to clear 'netstat -p tcp' stats

I guess lanadmin can do it.

Try with lanadmin menu driven command for each lan interface. you need nmid to this and lanscan command will give this.

-USA...
Good Luck..
Uday_S_Ankolekar
Honored Contributor

Re: how to clear 'netstat -p tcp' stats

I was wrong in my last post. I guess you can not clear the stats of netstat -s or netstat -p output.

-USA..
Good Luck..
Florian Heigl (new acc)
Honored Contributor

Re: how to clear 'netstat -p tcp' stats

lanadmin will only be able to reset the layer two counters as received octets etc.

You could try a ifconfig down / up but I don't think anything short of deleting the interface route will be able to flush the counters, and I don't think that's possible anywhere other than Cisco's IOS :)

May I ask what You're looking to achieve?
yesterday I stood at the edge. Today I'm one step ahead.
Bob_Vance
Esteemed Contributor

Re: how to clear 'netstat -p tcp' stats

Thanks, guys.

I'm familiar with 'lanadmin' and 'lsof'

I just wanted to monitor the drops during a period of heavy load and clearing the counters would make it easier to see the trend with a simple 'while netstat ...' loop.

I didn't want to code a script to take deltas of consecutive snapshots, which would be easy enough, but I'm just feeling lazy right now ;>).

It's no big deal -- I can live without it and probably will **not** code the script.

bv
"The lyf so short, the craft so long to lerne." - Chaucer