Re: seeing who is using the site..



The Natural Philosopher schreef:
Interesting problem. Who is 'online' to the site? and what pages are they accessing..

Ok, could just do a nasty bit of regexp on the logs..but what about every page extracting callers IP address, its own identity,(all my pages are php) and possibly what bits of the database are being accessed....

any ideas on a nice way to present this in a 'sysadmin' page?



Hi Philosopher,

The 'who-is-online' is a little hard on normal setups.
I approached it in the past like this, but that was on a site that demanded people to log on first:
1) Use session
2) Use DB storage of the sessions

Now you can easily check who is only, simply by looking in the session table.

If you don't use sessions, it is very hard to track such things.
You have no way of knowing if people simply close the browser, or go somewhere else.
Of course you can use the IP to do a little monitoring, but that fails when people use the same IP (as many do).
So cookies make more sense to track that, but then again, they can be disabled.
I think a session is the best way to monitor such things. They use URL rewriting or change the forms you use if cookies are disbaled.

Then, on every request to your website, use the session to update what you want in your monitoring logic.

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
.



Relevant Pages

  • perfmon2 syscall interface rationale
    ... the structure of a monitoring session and some of the basic ... No PMU hardware is actually accessed. ... configuration registers are ...
    (Linux-Kernel)
  • perfmon2 syscall interface rationale v2
    ... A monitoring session can be decomposed into a sequence of fundamental actions ... registers are set to a quiescent value. ... detachment with termination is problematic for both per-thread and CPU-wide ...
    (Linux-Kernel)
  • Re: [patch] Performance Counters for Linux, v3
    ... There was a reason why the scheduler decided to move the task. ... because of monitoring you would change the behavior of the task ... Any cpu-wide session trying to access C1 should fail. ...
    (Linux-Kernel)
  • Re: tip and serial console
    ... It is handy for monitoring, I use screen in an xterm and swatch to ... > a login session there, it is waiting for input to come online. ... > catch-22 sitution. ... > Software handshake rather than hardware handshake, ...
    (comp.unix.admin)
  • Re: Help can It spy on me during work
    ... In message, Moe Trin wrote: ... > I am constantly amazed by the perception that if a session is encrypted, ... just how many companies don't bother with monitoring, I know if I was IT ...
    (comp.os.linux.security)