WEB linux gurus, command to update users connected to port 80

Discussion in 'OT Technology' started by thomor25, Aug 9, 2007.

  1. thomor25

    thomor25 I make money online....

    Joined:
    Jun 11, 2000
    Messages:
    11,101
    Likes Received:
    0
    Location:
    Denver Colorado
    i use
    Code:
    netstat -n | grep 80 | wc -l
    to see how many users are connected but how to have that updated in realtime, don't I have to tail or something?
     
  2. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    I'm all about doing things in the most inefficient way, so this is my contribution: :o


    run_showcount.php:

    Code:
    <?
    $i = 1;
    while($i<10) {
    sleep(1);
    exec("netstat -n|grep 80|wc -l > /tmp/count.txt");
    $i = 1;
    }
    ?>
    
    show_count.php
    Code:
    <?
    include('/tmp/count.txt');
    ?>
    <meta http-equiv="refresh" content="5">
    
    execute run_showcount.php in the background from the cli, then access the showcount.php from the web. :o

    I'm sure there's a simple command for it.. but this works too.
     
  3. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    or if you only want it to display to stdout on the term, do

    Code:
    <?
    $i = 1;
    while($i<10) {
    sleep(3);
    exec("netstat -n|grep 80|wc -l");
    $i = 1;
    }
    ?>
    
    and it will show every 3 secs....
     
  4. FLY-FAST

    FLY-FAST OT Supporter

    Joined:
    Sep 30, 2003
    Messages:
    8,721
    Likes Received:
    3
    Location:
    boston, MA
    ftpcount - shows the current # of connections for each proftpd server conf. Then edit proftpd.conf
     
  5. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    he was looking for http connections
     
  6. FLY-FAST

    FLY-FAST OT Supporter

    Joined:
    Sep 30, 2003
    Messages:
    8,721
    Likes Received:
    3
    Location:
    boston, MA

    crazy > joo
     
  7. FLY-FAST

    FLY-FAST OT Supporter

    Joined:
    Sep 30, 2003
    Messages:
    8,721
    Likes Received:
    3
    Location:
    boston, MA
    ya I know, but, he could edit proftpd.conf to look @ 80 traffic
     
  8. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    que? :o
     
  9. thomor25

    thomor25 I make money online....

    Joined:
    Jun 11, 2000
    Messages:
    11,101
    Likes Received:
    0
    Location:
    Denver Colorado
    thanks man
     
  10. opie

    opie hi. OT Supporter

    Joined:
    Sep 29, 2004
    Messages:
    6,025
    Likes Received:
    0
    Location:
    AZ
    that's some ghetto php script.. looks like something i'd code
     
  11. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    cheap and dirty, it gets shit done. :o
     
  12. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    Why don't you turn on the stats page inside of apache. That way it gives you how many connected per second and a lot of other information.
     

Share This Page