Jeganath KS has asked for the wisdom of the Perl Monks concerning the following question:

I have 20 machines connected through LAN with a single gateway. I need to track/log those 20 machines activity from the gateway machine(I just need to log what are all the websites requested, and from which machine that website was requested). Can I do it with Perl script. If yes, can you please guide me.

  • Comment on How to track/log web page requests from client machine

Replies are listed 'Best First'.
Re: How to track/log web page requests from client machine
by JavaFan (Canon) on Aug 24, 2010 at 11:33 UTC
    Force the machines to use a proxy on the gateway. Use the proxy logs.
Re: How to track/log web page requests from client machine
by roboticus (Chancellor) on Aug 24, 2010 at 13:46 UTC

    Jeganath KS:

    You may be wondering why you're not getting any pointers to perl modules.

    For security purposes, operating systems don't want one process mucking around with other processes. Even if you had the ability to access everything you want, unless you had intimate knowledge of the internals of the applications, you wouldn't necessarily know what they were doing even when you knew the IP address. That's why you keep getting pointed at web server and proxy server logs. If you configure your servers, the log files will contain the information you want/need. Then you can read through the log files to get it.

    As you were informed on on your earlier post, there are already log analyzer programs available. So pick one, use it, and profit!

    ...roboticus

    Update: Fixed link to earlier post...

Re: How to track/log web page requests from client machine
by MidLifeXis (Monsignor) on Aug 24, 2010 at 13:40 UTC

    To further the above response, you could use Perl to parse the proxy logs, generate a report from those logs, web-enable queries against the logs, or a myriad of other tasks that Perl may be useful for. As the proxy itself, Perl is probably not the first choice I would look at. There are other tools out there that are much better - squid comes to mind as one of them.

    If you also want to ensure that your clients do not use anything except the proxy, ensure that your firewall only allows the proxy through. You will also need to ensure that other ports cannot be used to bypass the proxy through the firewall.

    --MidLifeXis