mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
fix a few bugs
This commit is contained in:
@@ -842,7 +842,7 @@ linux_exclusive_collection () { local PTFUNCNAME=linux_exclusive_collection;
|
|||||||
echo "threading $(getconf GNU_LIBPTHREAD_VERSION)" >> "$data_dir/summary"
|
echo "threading $(getconf GNU_LIBPTHREAD_VERSION)" >> "$data_dir/summary"
|
||||||
|
|
||||||
local getenforce=""
|
local getenforce=""
|
||||||
[ "$CMD_GETENFORCE" ] && $CMD_GETENFORCE 2>&1
|
[ "$CMD_GETENFORCE" ] && getenforce="$($CMD_GETENFORCE 2>&1)"
|
||||||
echo "getenforce ${getenforce:-"No SELinux detected"}" >> "$data_dir/summary"
|
echo "getenforce ${getenforce:-"No SELinux detected"}" >> "$data_dir/summary"
|
||||||
|
|
||||||
echo "swappiness $(awk '/vm.swappiness/{print $3}' "$data_dir/sysctl")" >> "$data_dir/summary"
|
echo "swappiness $(awk '/vm.swappiness/{print $3}' "$data_dir/sysctl")" >> "$data_dir/summary"
|
||||||
@@ -1692,30 +1692,11 @@ parse_lsi_megaraid_bbu_status () { local PTFUNCNAME=parse_lsi_megaraid_bbu_statu
|
|||||||
}
|
}
|
||||||
|
|
||||||
format_lvs () { local PTFUNCNAME=format_lvs;
|
format_lvs () { local PTFUNCNAME=format_lvs;
|
||||||
local lvs_file="$1"
|
local file="$1"
|
||||||
local vgs_file="$2"
|
if [ -e "$file" ]; then
|
||||||
|
grep -v "open failed" "$file"
|
||||||
if [ -e "$lvs_file" -a -e "$vgs_file" ]; then
|
|
||||||
local header="$(head -n1 "$lvs_file")$(head -n1 "$vgs_file" | sed -e 's/^ *VG//')"
|
|
||||||
|
|
||||||
echo "$header"
|
|
||||||
tail -n+2 "$lvs_file" | while read lvs_line; do
|
|
||||||
local current_vg="$(echo $lvs_line | awk '{print $2}')"
|
|
||||||
while read vgs_line; do
|
|
||||||
local current_vgs_vg="$(echo $vgs_line | awk '{print $1}' )"
|
|
||||||
if [ "$current_vg" = "$current_vgs_vg" ]; then
|
|
||||||
lvs_line="${lvs_line}$(echo $vgs_line | sed -e "s/^ *$current_vg//")"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done < "$vgs_file"
|
|
||||||
echo $lvs_line
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
if [ -e "$lvs_file" ]; then
|
echo "Unable to collect information";
|
||||||
cat "$lvs_file"
|
|
||||||
else
|
|
||||||
echo "Cannot execute 'lvs'";
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1988,7 +1969,9 @@ report_system_summary () { local PTFUNCNAME=report_system_summary;
|
|||||||
done
|
done
|
||||||
|
|
||||||
section "LVM_Volumes"
|
section "LVM_Volumes"
|
||||||
format_lvs "$data_dir/lvs" "$data_dir/vgs"
|
format_lvs "$data_dir/lvs"
|
||||||
|
section "LVM_Volume_Groups"
|
||||||
|
format_lvs "$data_dir/vgs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
section "RAID_Controller"
|
section "RAID_Controller"
|
||||||
|
Reference in New Issue
Block a user