~ubuntu-core-dev/eucalyptus/ubuntu-karmic

« back to all changes in this revision

Viewing changes to tools/get_xen_info

  • Committer: Dmitrii Zagorodnov
  • Date: 2009-01-27 21:53:41 UTC
  • mfrom: (25.1.112 eucalyptus-main)
  • Revision ID: dmitrii@cs.ucsb.edu-20090127215341-i0f0v6cmbpljmg02
merged with current main

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
4
4
$ENV{'PATH'}='/bin:/usr/bin:/sbin:/usr/sbin/';
5
5
 
 
6
$ret = 0;
 
7
 
6
8
chomp($str = untaint(`xm info | grep total_memory`));
7
9
$str =~ s/\s+:\s+/=/g;
8
 
print "$str\n";
 
10
if ($str =~ /.+=\d+/) {
 
11
    print "$str\n";
 
12
} else {
 
13
    $ret = 1;
 
14
}
9
15
 
10
16
chomp($str = untaint(`xm info | grep free_memory`));
11
17
$str =~ s/\s+:\s+/=/g;
12
 
print "$str\n";
 
18
if ($str =~ /.+=\d+/) {
 
19
    print "$str\n";
 
20
} else {
 
21
    $ret = 1;
 
22
}
13
23
 
14
24
chomp($str = untaint(`xm info | grep nr_cpus`));
15
25
$str =~ s/\s+:\s+/=/g;
16
 
print "$str\n";
 
26
if ($str =~ /.+=\d+/) {
 
27
    print "$str\n";
 
28
} else {
 
29
    $ret = 1;
 
30
}
17
31
 
18
32
chomp($str = untaint(`xm info | grep nr_nodes`));
19
33
$str =~ s/\s+:\s+/=/g;
27
41
    }
28
42
}
29
43
close(FH);
30
 
exit 0;
 
44
exit $ret;
31
45
 
32
46
sub untaint() {
33
47
    $str = shift;