#!/usr/bin/perl
my @nodes;
my $begin;
my $end;
my $lsload;
if($ARGV[0] eq "")
{
print("Usage: $0 nodexxx-nodexxx\n");
print(" $0 nodexxx\n");
exit 0;
}
my $SOURCE=`source /usr/local/lsf/conf/profile.lsf`;
if($ARGV[0] =~ /node[0-9]{3}\-node[0-9]{3}/)
{
@nodes = split /\-/, $ARGV[0];
$nodes[0] =~ /node([0-9]{3})/;
$begin = $1;
$nodes[1] =~ /node([0-9]{3})/;
$end = $1;
$lsload = `lsload node$begin`;
print "$lsload";
if($begin <=($end -1))
{
for($i = $begin+1; $i <= $end; $i ++)
{
if($i < 10)
{
$lsload = `lsload node00$i| grep -v HOST`;
}
elsif($i >= 10 && $i < 100)
{
$lsload = `lsload node0$i| grep -v HOST`;
}
elsif($i >= 100 && $i <= 192)
{
$lsload = `lsload node$i| grep -v HOST`;
}
else
{
last;
}
print $lsload;
}
}
}
elsif($ARGV[0] =~ /node[0-9]{3}/)
{
$lsload=`lsload $ARGV[0]`;
print $lsload;
exit 0;
}
else
{
print("Usage: $0 nodexxx-nodexxx\n");
print(" $0 nodexxx\n");
exit 0;
}
阅读(2811) | 评论(0) | 转发(0) |