User Tools

Site Tools


netstat

Apache Connection IPs and Connection State

Cent OS 6

netstat -pant | awk '/http/ {print $5, $6}' | awk -F: '{print $4 , $5}' | awk '{print $1, $3}' | sort -k1 | uniq -c | sort -rn

Ubuntu:
netstat -pant | awk '/apache2/ {print $5, $6, $7}' | awk -F'[: /]' '{print $1, $3, $5}' | sort | uniq -c | sort -rn
Example output:
     63 x.x.x.x CLOSE_WAIT apache2
     58 127.0.0.1 ESTABLISHED apache2
      9 127.0.0.1 SYN_SENT apache2
      1 10.x.x.254 CLOSE_WAIT apache2
      1 10.x.x.252 CLOSE_WAIT apache2
      1 10.x.x.251 CLOSE_WAIT apache2
      1 10.x.x.250 CLOSE_WAIT apache2

Close_Wait Connections Summary

netstat -pant | awk -F: '/CLOSE.*httpd/ {print $8}' | sort | uniq -c | sort -rn

netstat.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki