41
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

netstatで接続数カウント

Last updated at Posted at 2014-07-01

接続状態の確認と接続元IPのカウントをnetstatで行う。

80番ポート状態カウント

netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c

      2 ESTABLISHED
      1 LISTEN
     18 TIME_WAIT

接続元ホストカウント

$ netstat -tan | grep ':80 ' | awk '{print $5}'  | cut -d : -f1 | sort -n | uniq -c | sort -n

      1 0.0.0.0
      1 1.78.2.xx
      1 180.9.50.xx
      1 182.249.240.xx
      1 182.249.246.xx
      1 203.139.205.xx
      1 210.147.29.xx
      1 221.191.193.xx
      1 27.142.240.xx
      1 61.125.133.xx
      2 221.189.114.xx
      2 49.98.130.xx
      2 59.128.83.xx
      2 66.249.79.xx
      6 60.138.174.xx
41
43
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?