Commit fd86aed4 authored by Fulvio Galeazzi's avatar Fulvio Galeazzi
Browse files

2021-11-26: FG; Fix Ceph numObjects, ensure queryTotDisk is not hindered by messages to stderr.

parent de005479
......@@ -167,9 +167,13 @@ foreach my $_line (@_data)
$poolHash{'GLOBAL'}{'size'} = convertNumber($fields[7].$fields[8],'size');
$poolHash{'GLOBAL'}{'frac'} = $fields[9];
### In Nautilus, total number of objects is not available
my @_tmpDfOut = `$cephCmd -s | grep objects:`;
my $tmpLine = $_tmpDfOut[0];
$tmpLine =~ s/^\s*//;
my @tmpArr = split(/\s+/, $tmpLine);
$poolHash{'GLOBAL'}{'objs'} = convertNumber($tmpArr[1],'count');
# $poolHash{'GLOBAL'}{'objs'} = convertNumber($fields[5],'count');
# print "GLOBAL: ".$poolHash{'GLOBAL'}{'size'}." ".$poolHash{'GLOBAL'}{'frac'}." ".$poolHash{'GLOBAL'}{'objs'}."\n" if (defined $opt_debug);
print "GLOBAL: ".$poolHash{'GLOBAL'}{'size'}." ".$poolHash{'GLOBAL'}{'frac'}."\n" if (defined $opt_debug);
print "GLOBAL: ".$poolHash{'GLOBAL'}{'size'}." ".$poolHash{'GLOBAL'}{'frac'}." ".$poolHash{'GLOBAL'}{'objs'}."\n" if (defined $opt_debug);
$inGlobal = 0;
next;
}
......
......@@ -72,7 +72,7 @@ if ( -e $_multipathd && $checkMultipath ) {
}
}
my @_lsblk = `lsblk | grep disk | cut -d' ' -f1 | grep -v -e ^fd -e ^sr0 `;
my @_lsblk = `lsblk 2>/dev/null | grep disk | cut -d' ' -f1 | grep -v -e ^fd -e ^sr0 `;
chomp @_lsblk;
my @_data = `cat $_proc`;
s{^\s+|\s+$}{}g foreach @_data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment