On Fri, Dec 28, 2001 at 11:26:39AM +0530, VaibhaV Sharma wrote: > - 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.
This is because the first time the browser connects, it does not send authentication information. Then onwards, till the end of the browser's lifetime, it sends the authentication information everytime (for every request). Some browsers can be configured (I think lynx, with -pauth)/patched (other open source browsers, for example) to send the authentication info everytime, so this entry is not as reliable as it sounds. > - Put an authentication timeout in squid so that the user authenticates > after that time and you get another Denied entry in the log file. If the browser (think IE) hasn't been restarted in that interval, I don't think you will get this entry. > - 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. Yuk ;-) Considering that the average web page nowadays include about 50 images, CSSes, frames, 30x, whatnots etc., even a five minute interval might require you to parse through thousands of log entries in a reasonably sized LAN. 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. The user logs out when the page/image he requested is served by squid and the browser/proxy socket connection is closed. HTTP is a stateless protocol; so you cannot do what you want reliably, and it is not even a measure of the user's internet usage. What you want is probably the number of bytes the user retrieved from the net (maybe you can count TCP_HITs also). My only suggestion is to write your own authentication_program for squid, and make it authenticate/restrict your user to your liking. There are no reliable out of the box solution for this, AFAICT. Binand _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
