I'm exploring building an internal site that displays what computers in the lab are currently being used. My initial idea involved a webapp that took in info from each computer every 5-10 minutes and then displayed that information. What I'm wondering is if there's a good way of getting the status of a machine (if it's logged on, and what program is currently on top)? Is this something that can be done at the shell level? (for instance, some sort of chron job, or script that runs while somebody is logged on).
Asked
Active
Viewed 25 times
1 Answers
0
Things might have changed since I last checked this (10.6.5ish), but a user running Dock was usually a good indicator he/she is logged in:
ps aux | grep Dock
And you can get a sort of list of running apps by running:
ps aux | grep /Applications/
This is a little bit weak because some apps run outside of the /Applications folder..

Tim
- 3,017
- 17
- 15