Sometimes, specially in small computational groups, it is usual that the people uses the workstations for running calculations, and in case of a “trusted” network, were all the colleagues can log-in to each other’s computers, it is sometimes also the case, that everybody calculates everywhere. But at the moment of submitting a calculation, if your own PC is already busy, how do I find a computer in my network, which is not running anything at the moment?
You could ssh to each host and run <it>top</it> or something like that, but that is really slow when you have a lot of computers, and you have vs. to repeat the task very often.
The solution: “checkpc”
checkpc is a python script which can scan a whole network of computers and return the load of all PCs within it in less than 3 seconds.
It can use pssh (parallel ssh) so that it submits all the requests at one time, and receives the replies in something between 1 and 2 seconds after (depending on the load of the systems).
pssh (or ssh) connect to each host and execute an script locally (~/.checkpc_local) which returns the hostname, CPU load, Memory load, cores in use, and who is consuming the most of the CPU in the current workstation.
Finally, as usual in my system administration scripts I put some colors, so it is faster and nicer to find out where to send the calculation.