/[vz-tools]/trunk/vz-memory-usage.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/vz-memory-usage.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (hide annotations)
Tue Oct 21 18:12:52 2008 UTC (14 years, 3 months ago) by dpavlin
File MIME type: application/x-sh
File size: 744 byte(s)
this script requires tools available at:

http://svn.rot13.org/index.cgi/perl/checkout/trunk/groupby.pl
http://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
1 dpavlin 55 # this script requires tools available at:
2     #
3     # http://svn.rot13.org/index.cgi/perl/checkout/trunk/groupby.pl
4     # http://svn.rot13.org/index.cgi/perl/checkout/trunk/sum.pl
5    
6     # and module not available in lenny:
7     #
8     # cpanp i IPC::System::Simple
9    
10     # insert following in /etc/sudoers if you are in staff group on remote machine for this to work:
11     #
12     # %staff ALL=(root) NOPASSWD: /usr/sbin/vzlist
13    
14     if [ ! -z $1 ] ; then
15     echo "# $1"
16     ssh $1 vzps -E axv --no-headers | groupby.pl 'sum:($7+$8+$9*1024),1,count:1' --join "ssh $1 sudo vzlist -H -o veid,hostname" --on 2 | sort -rn | align | sum.pl -h
17     else
18     vzps -E axv --no-headers | groupby.pl 'sum:($7+$8+$9*1024),1,count:1' --join 'sudo vzlist -H -o veid,hostname' --on 2 | sort -rn | align | sum.pl -h
19     fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26