Faster way to count TCP connections

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Hazhir
Posts: 1
Joined: Tue Aug 27, 2013 9:20 am

Faster way to count TCP connections

Post by Hazhir »

Hi,

We have a server which actively receives large number of TCP connections. Normal check (netstat) on number of connections takes about at least 20Sec. We would like to find a much faster way to do this.

Any help or hint is highly appreciated.

Thank you.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Faster way to count TCP connections

Post by abrist »

The following runs very fast on my test box:

Code: Select all

netstat -t | wc -l
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked