Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    1,005

    Command to get the number of connections

    Can anyone please tell me which command will give me current establishd and time wait connections to a particular subdomain on my server ?

    Which command can give me the processfiles list currently loaded in RAM ?
    Best Regards,
    Namesniper

  2. #2
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    Quote Originally Posted by NameSniper
    Can anyone please tell me which command will give me current establishd and time wait connections to a particular subdomain on my server ?
    netstat -plane

    Quote Originally Posted by NameSniper
    Which command can give me the processfiles list currently loaded in RAM ?
    ps -aux
    ipcs (lists shared memory allocation)
    free -m (displays free memory)

  3. #3
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    Quote Originally Posted by NameSniper
    Can anyone please tell me which command will give me current establishd and time wait connections to a particular subdomain on my server ?
    If that particular subdomain is a name-based virtualhost, you have to use something like mod_status as netstat cannot discriminate between different subdomains sharing the same IP.
    WK Woon
    CTO | http://www.aflexi.net - A flexible Network
    Building the next generation CDN platform - DEMO .... coming soon

  4. #4
    Join Date
    Dec 2006
    Posts
    66
    You can use
    netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1

    This will show the IPs and the number of hits from the IPs to a port. That 80 shows for port 80. U can change it to any port

    If you wanna filter it to established connections once again grep it using string 'ESTABLISHED' or for getting time wait connections grep using string 'TIME_WAIT' after greping to port 80

  5. #5
    Join Date
    Mar 2004
    Posts
    1,005
    wKkaY can you please give me the syntax to use mod_status

    cybersavvy the command didnt worked out as i am on freebsd,can you please post the one for freebsd ?
    Best Regards,
    Namesniper

  6. #6
    Join Date
    Mar 2006
    Posts
    418
    Quote Originally Posted by NameSniper
    wKkaY can you please give me the syntax to use mod_status

    cybersavvy the command didnt worked out as i am on freebsd,can you please post the one for freebsd ?
    Mod status is something you install in addition to apache

    http://httpd.apache.org/docs/2.0/mod/mod_status.html
    || Semi-professional PHP developer || Exams right now, don't I just feel lucky? ||

  7. #7
    Join Date
    Dec 2006
    Posts
    66
    1. For finding out TIME_WAIT connections

    netstat -an | grep .80 | grep TIME_WAIT


    2. For finding out ESTABLISHED connections

    netstat -an | grep .80 | grep ESTABLISHED


    Regards
    Reverse engineering Rocks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •