I need to execute an application (glance) on various machines that will get memory and CPU utilization and then email the results back to me.

The file reading and email part is complete but being VERY new to perl, I don't know how to log on to the various boxes, run the command, pipe the output to a file, and the stop the command.

Here is some pseudo code for what I need to do:

Every two hours (automatic run)
--for each machine in machines_list
----sign on to machine
----start up glance
----send the output to a file
----stop glance
----read in the file
----email the results


Alternately I could run the perl script on each and every machine so the signing on part can really be omitted if it's a pain, so the logic an become:

Every two hours (automatic run)
--start up glance
--send the output to a file
--stop glance
--read in the file
--email the results

Can someone tell me the code to do first few steps please?

Thanks.