I want to write a program that ssh's into remote boxes and runs jobs there if the remote computer is not actively being used. I'll be logging in as clusterJobRunner@remoteBox, and the other user will be logged in as someLocalUser@remoteBox. 
Is there a way to see if a remote user is actively using the box using either Python or Java?
In Java you can execute the users Linux command using Runtime.exec(), grab the standard output and get it into a parsable String.  I don't think there are any OS-independent ways to do this.
How can I find out if someone is actively using a Linux computer in Python or Java?