4129290 1675967 2412031 41% /usr
####
sub sorter (@)
{
@beforeSort=@_;
print "before sort: $beforeSort[2][4]\n";
@sorted_by_drive=sort{$a->[4] cmp $b->[4]} @beforeSort;
print "Sorted by drive: $sorted_by_drive[2][4]\n";
return @sorted_by_drive;
}
####
sub parseIntoArraySolaris (@df)
{
$arrayCount=0;
@rows;
@col0;
@col1;
@col2;
@col3;
@col4;
@col5;
@col6;
@col7;
@col8;
@col9;
@col10;
$rows[0]=\@col0;
$rows[1]=\@col1;
$rows[2]=\@col2;
$rows[3]=\@col3;
$rows[4]=\@col4;
$rows[5]=\@col5;
$rows[6]=\@col6;
$rows[7]=\@col7;
$rows[8]=\@col8;
$rows[9]=\@col9;
$rows[10]=\@col10;
foreach $element (@_)
{
($a, $b, $c, $d, $e, $f)=split(/\s+/,$element); #splits strings separated by spaces,tabs
########################################################################################
#$rows[0][x] is just the column headings, Filesystem, kbytes, used, avail etc.
#$rows[not zero][x] are the actual data.
#for Windows, telnet cannot get the disk info, so we have to save the info into a file,
#use the FTP package to ftp (using ftppackage.pl package) the file to the local system,
#and use this 2-dim array to parse the data from the file.
########################################################################################
$rows[$arrayCount][0]=$b/1024;
$rows[$arrayCount][1]=$c/1024;
$rows[$arrayCount][2]=$d/1024;
$rows[$arrayCount][3]=$e/1024;
$rows[$arrayCount][4]=$f/1024;
#$rows[$arrayCount][5]=$f;
print "$rows[$arrayCount][0]\n";
print "$rows[$arrayCount][1]\n";
print "$rows[$arrayCount][2]\n";
print "$rows[$arrayCount][3]\n";
print "$rows[$arrayCount][4]\n";
#print "$rows[$arrayCount][5]\n";
########################## To get to the value of the array, use $array[$row][$column];
########################## example: print "This is: $rows[$arrayCount][5]\n";
$arrayCount++;
}
return @rows; #returns the entire two-dimensional array.
}