Hello Mukund, Have faced this problem a while back when I was working on an accounting software which extracts user activity based on squid / sendmail logs.
Its difficult to put a fix on when the user logged in / logged out, but there are several work arounds which you'll can customise. I don remember the exact options we considered but here are a few - - Whenever a user is authenticated, squid puts a Denied entry in the log, signifying that the access was denied because the user was not authenticated. The Squid http style log would show you the username involved too. This can be taken as the login time. - Put an authentication timeout in squid so that the user authenticates after that time and you get another Denied entry in the log file. - Parse the log file with a timeout, i.e. parse the log entries finding out the time difference between every log entry. If the difference in any two log entries is more than, say 5 mins, then take the first entry as the logout time and the next one as the next login. This is cruddy and very inaccurate, but it works. - Write a small application which runs on the client side. The user specifies his user / password to the app, the app connects to the server which is running another small app which takes this login / pass, adds the client's IP to the allowed IP's acl and runs squid -k reconfigure and if you want, update your accounting entries from here directly. When the client program exits, remove the client IP from the allowed acl's and mark a user logout. This is cruddy too, but if implemented well, would work perfectly. For us, things got more interesting when we were required to generate the accounting data in real time (e.g. for a cybercafe) for which we had to parse the squid log file in real time. Don ask me how we managed to do that. It was cruddy! ;-) Its been long that I worked to find a solution for this particular problem, maybe something better is available at the squid authentication level. Dunno about that. Check once before opting for any of the above. HTH. VaibhaV On Wed, 2001-12-26 at 07:00, mukund wrote: > I have successfully tested user login (via /etc/passwd) in squid. However I > did not find any logs when user logs out of squid. > I want to calculate for time period for which the user was logged to squid. > > Regards, > Mukund Deshmukh _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
