this script requires tools available at:
https://svn.rot13.org/index.cgi/perl/checkout/trunk/groupby.pl
https://svn.rot13.org/index.cgi/perl/checkout/trunk/sum.pl
and module not available in lenny:
cpanp i IPC::System::Simple
insert following in /etc/sudoers if you are in staff group on remote machine for this to work:
%staff ALL=(root) NOPASSWD: /usr/sbin/vzlist
|