Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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).

share|improve this question
add comment

1 Answer

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..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.