chjwang / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Provide information about connected users #229

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This feature would be similar to what is provided by "who" command.
On Unix this info can be extracted from the utmp structure:
http://linux.die.net/man/5/utmp
From there we can extract various information such as connected usernames, 
associated terminals (tty) and login times.

There's a python binding available here:
http://software.clapper.org/pyutmp/

As for the API, I image a "psutil.get_users()" function returning a list of 
namedtuples for every connected user.

I still have to look into the Windows implementation (actually I still have to 
look into everything =)).

Original issue reported on code.google.com by g.rodola on 9 Nov 2011 at 7:57

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 9 Nov 2011 at 7:57

GoogleCodeExporter commented 8 years ago
Use WTSEnumerateSessions.

Original comment by wj32...@gmail.com on 9 Nov 2011 at 8:04

GoogleCodeExporter commented 8 years ago
Thanks wj32.64.
Initial commit for POSIX systems checked in as r1222 (tested on Linux only).

Original comment by g.rodola on 9 Nov 2011 at 10:58

GoogleCodeExporter commented 8 years ago
FreeBSD implementation checked in as r1224.

Original comment by g.rodola on 10 Nov 2011 at 12:53

GoogleCodeExporter commented 8 years ago
Committed code temporarily removed as of r1237 because we're going to have an 
intermediate bug-fix only release.

Original comment by g.rodola on 14 Dec 2011 at 5:58

GoogleCodeExporter commented 8 years ago
This is now fixed.
Linux: r1268
Windows: r1270
FreeBSD: r1274
OSX: r1278

Original comment by g.rodola on 9 Mar 2012 at 3:29

GoogleCodeExporter commented 8 years ago
0.5.0 is finally out. Closing out as fixed.

Original comment by g.rodola on 27 Jun 2012 at 6:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1222 == revision c8f293ea16c1
r1224 == revision e604889f303b
r1237 == revision 28f19fcf4713
r1268 == revision 55627e4776b0
r1270 == revision 972bc30dc941
r1274 == revision 4921697a3650
r1278 == revision 805a6d68c55b

Original comment by g.rodola on 2 Mar 2013 at 12:05