[Tfug] How to detect graphical logins?

Jeff Breadner jeff at breadner.net
Wed Jun 4 16:35:14 MST 2008


Brian Murphy wrote:
> I don't think such a thing exists.  Standard tools that show who is 
> logged in do it by reading utmp.  As you've discovered, this is advisory 
> and thus not perfect.  You can add the -query localhost option to Xvnc 
> (the vnc server) to force clients to login via xdm which in turn could 
> be configured to use sessreg on startup and reset to register/remove the 
> user in utmp.(this sessreg step might already be done by your 
> distributor)  Make sure that xdm or the GNOME/KDE/CDE equivalent is 
> listening for the XDMCP query.
>
> As for how many users, I guess that depends on how you want to count me 
> if I log in twice...just "me" or as 2 logins on the system.
>
> The unix admin in me is more often concerned with what the users are 
> doing, not so much who they are... because if they weren't supposed to 
> be there, they shouldn't have an account.  If you have to do something 
> like chargebacks for runtime, process accounting would be a far better 
> avenue to explore than this.  /etc/security/limits.conf might also be of 
> interest to you on linux for per-user limits.
>
> Brian
>   

Yeah, we're just writing a little 'system health' utility similar to 
Nagios that tracks how the underlying OS is working, as well as our 
application that runs on top of it.  The idea with tracking the number 
of logins was to give an estimate as to how busy the system is, we 
already track CPU load, memory usage, swap usage, disk usage etc.  but 
maybe a memory footprint and thread count per user might be better 
benchmarks.  Especially on systems where remote users log in with 
Reflections, Exceed or NX, which makes things even more difficult.

The idea with tracking graphical logins is that some users have a 
tendency to just kill the VNC session without logging out properly, and 
if the server-side VNC stuff wasn't set up properly at install time then 
the session won't time out and die.  This test would tell us if a) 
people need to be educated as to how to log out properly, or if b) we 
need to have a closer look at the VNC setup to ensure that these old 
sessions kill themselves if they're unused for a given amount of time.

We already do -query localhost I think, but I'll double check and read 
up more on that option.  If I'm stuck grepping the process list, then so 
be it ;)  Thanks for the feedback.

cheers
  JB




More information about the tfug mailing list