File:
[LON-CAPA] /
loncom /
debugging_tools /
get_version.pl
Revision
1.3:
download - view:
text,
annotated -
select for diffs
Wed Jun 6 20:04:47 2007 UTC (17 years, 6 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_2_9_X,
version_2_9_99_0,
version_2_9_1,
version_2_9_0,
version_2_8_X,
version_2_8_99_1,
version_2_8_99_0,
version_2_8_2,
version_2_8_1,
version_2_8_0,
version_2_7_X,
version_2_7_99_1,
version_2_7_99_0,
version_2_7_1,
version_2_7_0,
version_2_6_X,
version_2_6_99_1,
version_2_6_99_0,
version_2_6_3,
version_2_6_2,
version_2_6_1,
version_2_6_0,
version_2_5_X,
version_2_5_99_1,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0_RC1,
version_2_10_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
bz6209-base,
bz6209,
bz5969,
bz2851,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3,
GCI_2,
GCI_1,
BZ5971-printing-apage,
BZ5434-fox,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
- added distprobe gather, and 64bitedness gathering, and some other reporting modes
open(HOST,"<$ARGV[0]");
if (!-e 'secure_args') {
die("Unable to find security arguments for grabbing lon-status");
}
my $secure_args = `cat secure_args`;
$secure_args =~ s/^\s*//x;
$secure_args =~ s/\s*$//x;
my $i++;
my %vers;
my %distvers;
my %arch;
my %done;
my %combo1;
my %combo2;
while(my $line=<HOST>) {
if ($line=~/^\#/) { next; }
my $host=(split(':',$line))[3];
chomp($host);
if (!$host || exists($done{$host})) { next; }
$done{$host}=1;
my $roles=`curl --max-time 15 --connect-timeout 5 -s http://$host/adm/login `;
if ($roles eq '') {
$roles=`curl --insecure --max-time 15 --connect-timeout 5 -s https://$host/adm/login `;
}
#-- lon-capa version
print($host." -> ");
my $ver=`curl --max-time 15 --connect-timeout 5 -s http://$host/adm/login | grep -- -200 | tr ">" "\n" | tail -1 `;
$ver=~s/ //g;
$ver=~s/ //g;
if ($ver eq "") {
print(" https -> ");
$ver=`curl --insecure --max-time 15 --connect-timeout 5 -s https://$host/adm/login | grep -- -200 | tr ">" "\n" | tail -1 `;
}
$ver=~s/ //g;
$ver=~s/ //g;
if ($ver eq "") {
if ($roles eq '') { $ver="dead\n"; } else { $ver = "old\n" }
}
print($ver);
$ver=~s/\s//g;
push(@{$vers{$ver}},$host);
print(' 'x(length($host)).' -> ');
my $lonstatus=`curl $secure_args --max-time 15 --connect-timeout 5 -s http://$host/lon-status/ `;
if ($lonstatus !~ /LON Status Report/) {
print(" https -> ");
$lonstatus=`curl --insecure $secure_args --max-time 15 --connect-timeout 5 -s https://$host/lon-status/ `;
}
if ($lonstatus =~ /LON Status Report/) {
print(" lon-status \n");
}
#-- OS
my $dist = $lonstatus;
print(' 'x(length($host)).' -> ');
my $re = '.*distprobe.*?<pre>(.*?)</pre>.*';
# my $re = '.*?<h1>.*?</h1>.*?<h2>(.*?)</h2>.*';
if ($dist =~ m{$re}sx) {
$dist=~s{$re}{$1}sx;
print($dist);
} else {
undef($dist);
}
print("\n");
push(@{$distvers{$dist}},$host);
#-- arch
my $arch = $lonstatus;
print(' 'x(length($host)).' -> ');
my $re = '.*?Detected\s+64bit\s+platform\s*\((\d*)\).*';
if ($arch =~ m{$re}sx) {
$arch=~s{$re}{$1}sx;
print($arch);
} else {
undef($arch);
}
print("\n");
push(@{$arch{$arch}},$host);
$combo1{"$ver,$dist,$arch"}++;#.=$host.', ';
$combo2{"$dist,$arch"}++;#.=$host.', ';
# if ($i++==14) { last; }
}
print("LON-CAPA Versions\n");
foreach my $key (sort(keys(%vers))) {
print($key." -> ".scalar(@{$vers{$key}})." machines\n");
print(" ".join("\n ",sort(@{$vers{$key}}))."\n");
}
print("OS Versions\n");
foreach my $key (sort(keys(%distvers))) {
print($key." -> ".scalar(@{$distvers{$key}})." machines\n");
print(" ".join("\n ",sort(@{$distvers{$key}}))."\n");
}
print("64bit?\n");
foreach my $key (sort(keys(%arch))) {
print($key." -> ".scalar(@{$arch{$key}})." machines\n");
print(" ".join("\n ",sort(@{$arch{$key}}))."\n");
}
print("Combo 1?\n");
foreach my $key (sort(keys(%combo1))) {
print($key." -> ".$combo1{$key}." machines\n");
}
print("Combo 2?\n");
foreach my $key (sort(keys(%combo2))) {
print($key." -> ".$combo2{$key}." machines\n");
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>