Thread: Code for Monitoring Website activities

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    2

    Code for Monitoring Website activities

    Hi,

    I want to make a daemon-like application for Linux platform which supervises the website activities. I need to fetch the URLs of all websites that are opened by the user, time of the day when it is opened & the time duration for which this url is opened and by-page activity. A code snippet will be much helpful.
    Alsoo, I do not want to monitor the URLs of any specific web-browser like firefox, konqueror etc, and want a generalized solution for this problem.

    Any help/ code snippet is really very appreciated.

    Regards,
    Manoj Kumar

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Even if they're using anonymous proxies?

    And why do you think such an involved piece of work could be readily summed up with "a code snippet"?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Get Squid and proxy all of your users through it. You _can_ proxy the local users too with squid.

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    For total browser independence, and to avoid relying on a proxy, it seems the only option is to monitor ALL outgoing TCP connections and see if the first data transmitted by the client on those connections looks like an HTTP request header.

    That means you need to look for all initiated connections (SYN-ACK-ACK triples), then place the connection in a bucket to scan for HTTP activity -- once you've decided there is no HTTP activity on that connection, you can purge it from the bucket.

    A "code snippet" can't possibly convey what is involved here.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    If you haven't yet look at the pcap library. A customized packet sniffer could easily do this.

    Programming with pcap
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Proposal: Code colouring
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  2. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. Replies: 6
    Last Post: 04-04-2003, 10:09 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM