Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Get List Of Connections By Ip

Discussion in 'General Discussion' started by dorac, Jul 30, 2015.

  1. dorac

    dorac Member

    Joined:
    Jun 7, 2013
    Messages:
    22
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    South Africa
    cPanel Access Level:
    Root Administrator
    Hey guys,

    Would anyone know how to get a list of ip addresses that connect to the server, summarize and sort it to ip addresses by connection for a given time period?

    eg. I want the list for July '15

    123.124.125.126 - 2431 Connections
    111.110.100.10 - 1234 Connections
    90.57.28.87 - 542 Connections
    ....

    Any ideas?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,897
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You may find this command helpful:

    Code:
    netstat -ntu | awk ' $5 ~ /^[0-9]/ {print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
    However, note you can't list the connection by time period because the data is not stored.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice