3
  • Ubuntu Server 10.04.1 x86
  • Munin 1.4.4

Here is what Munin tells me about connections through firewall on my server:

TIME_WAIT

Here is what netstat -n has to say about this:

$ netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c
      2 CLOSE_WAIT
      1 CLOSING
   3720 ESTABLISHED
     34 FIN_WAIT1
     21 FIN_WAIT2
     13 LAST_ACK
      6 LISTEN
      4 SYN_RECV
    394 TIME_WAIT

According to netstat, 10% of sockets are in TIME_WAIT; 75% or more, according to Munin.

That is strange. Who is right?

More details about configuration etc. here: How to reduce number of sockets in TIME_WAIT?

Alexander Gladysh
  • 2,343
  • 7
  • 30
  • 47

1 Answers1

5

netstat doesn't show connections that are passing through the server as a gateway / firewall.

The munin-plugin parses /proc/net/ip_conntrack, which contains a lot of information not visible in netstat.

The answer; Both are right, but they answer different questions. Netstat talks about connections to and from the server itself. Conntrack provides information about traffic passing the server, so it can make sure to do address translation and so forth correctly.

Kvisle
  • 4,113
  • 23
  • 25