sub usage()
{
print STDERR "Usage: $pname [-c] [-g] [-i <interval>] [-h <help>] <stats_file>\n";
- print STDERR " stats_file : /proc/fs/lustre/.../stat\n";
+ print STDERR " stats_file : lustre/.../stat\n";
print STDERR " -i interval: polling period\n";
print STDERR " -c : clear stats file first\n";
print STDERR " -g : graphable output format\n";
print STDERR " -h : help, display this information\n";
- print STDERR "example: $pname -i 1 ost (monitors /proc/fs/lustre/ost/OSS/ost/stats)\n";
+ print STDERR "example: $pname -i 1 ost (monitors lustre/ost/OSS/ost/stats)\n";
print STDERR "Use CTRL + C to stop statistics printing\n";
exit 1;
}
chop;
($name, $cumulcount, $samples, $unit, $min, $max, $sum, $sumsquare)
= split(/\s+/, $_);
- $prevcount = %cumulhash->{$name};
+ $prevcount = $cumulhash->{$name};
if (defined($prevcount)) {
$diff = $cumulcount - $prevcount;
if ($name eq "snapshot_time") {
}
if (defined($sum)) {
my $sum_orig = $sum;
- my $sum_diff = $sum - %sumhash->{$name};
+ my $sum_diff = $sum - $sumhash->{$name};
if ($graphable) {
printf " %s %lu %.2f %lu %s",
$name, $sum_diff, ($sum_diff/$tdiff), $sum, $unit;
$anysumsquare = 1;
}
}
- %cumulhash->{$name} = $cumulcount;
- %sumhash->{$name} = $sum;
+ $cumulhash->{$name} = $cumulcount;
+ $sumhash->{$name} = $sum;
} #end of while
}
#Globals
$pname = $0;
-$defaultpath = "/proc/fs/lustre";
$obdstats = "stats";
$clear = 0;
$graphable = 0;
} elsif ( -f "$obddev/$obdstats" ) {
$statspath = "$obddev/$obdstats";
} else {
- my $st = glob("$defaultpath/*/$obddev/$obdstats");
+ my $st = glob("/{proc,sys}/fs/lustre/*/$obddev/$obdstats");
if ( -f "$st" ) {
$statspath = $st;
} else {
- $st = glob("$defaultpath/*/*/$obddev/$obdstats");
+ $st = glob("/{proc,sys}/fs/lustre/*/*/$obddev/$obdstats");
if ( -f "$st" ) {
$statspath = $st;
}