mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 21:19:59 +00:00
(temp commit, syncing up)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1912
bin/pt-summary
1912
bin/pt-summary
File diff suppressed because it is too large
Load Diff
192
lib/bash/collect_mysql_info.sh
Normal file
192
lib/bash/collect_mysql_info.sh
Normal file
@@ -0,0 +1,192 @@
|
||||
# This program is copyright 2011-2012 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# collect_mysql_info package
|
||||
# ###########################################################################
|
||||
|
||||
# Package: collect_mysql_info
|
||||
# collect collects mysql information.
|
||||
|
||||
# XXX
|
||||
# THIS LIB REQUIRES log_warn_die.sh, summary_common.sh, and alt_cmds.sh!
|
||||
# XXX
|
||||
|
||||
# Simply looks for instances of mysqld in the outof of ps.
|
||||
collect_mysqld_instances () {
|
||||
local file="$1"
|
||||
ps auxww 2>/dev/null | grep mysqld > "$file"
|
||||
}
|
||||
|
||||
# Tries to find the my.cnf file by examining 'ps' output.
|
||||
# You have to specify the port for the instance you are
|
||||
# interested in, in case there are multiple instances.
|
||||
find_my_cnf_file() {
|
||||
local file="$1"
|
||||
local port=${2:-""}
|
||||
|
||||
local cnf_file=""
|
||||
if test -n "$port" && grep -- "/mysqld.*--port=$port" "${file}" >/dev/null 2>&1 ; then
|
||||
cnf_file="$(grep -- "/mysqld.*--port=$port" "${file}" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }' \
|
||||
| head -n1)"
|
||||
else
|
||||
cnf_file="$(grep '/mysqld' "${file}" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }' \
|
||||
| head -n1)"
|
||||
fi
|
||||
|
||||
if [ ! -n "${cnf_file}" ]; then
|
||||
_d "Cannot autodetect config file, trying common locations"
|
||||
cnf_file="/etc/my.cnf";
|
||||
if [ ! -e "${cnf_file}" ]; then
|
||||
cnf_file="/etc/mysql/my.cnf";
|
||||
fi
|
||||
if [ ! -e "${cnf_file}" ]; then
|
||||
cnf_file="/var/db/mysql/my.cnf";
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$cnf_file"
|
||||
}
|
||||
|
||||
collect_mysql_variables () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW /*!40100 GLOBAL*/ VARIABLES' > "$file"
|
||||
}
|
||||
|
||||
collect_mysql_status () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW /*!50000 GLOBAL*/ STATUS' > "$file"
|
||||
}
|
||||
|
||||
collect_mysql_databases () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW DATABASES' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_mysql_plugins () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW PLUGINS' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_mysql_slave_status () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW SLAVE STATUS' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_mysql_innodb_status () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW /*!50000 ENGINE*/ INNODB STATUS' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_mysql_processlist () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW FULL PROCESSLIST' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_mysql_users () {
|
||||
local file="$1"
|
||||
$CMD_MYSQL $EXT_ARGV -ssE -e 'SELECT COUNT(*), SUM(user=""), SUM(password=""), SUM(password NOT LIKE "*%") FROM mysql.user' > "$file" 2>/dev/null
|
||||
}
|
||||
|
||||
collect_master_logs_status () {
|
||||
local master_logs_file="$1"
|
||||
local master_status_file="$2"
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW MASTER LOGS' > "$master_logs_file" 2>/dev/null
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW MASTER STATUS' > "$master_status_file" 2>/dev/null
|
||||
}
|
||||
|
||||
# Somewhat different from the others, this one joins the status we got earlier
|
||||
collect_mysql_deferred_status () {
|
||||
local status_file="$1"
|
||||
local defer_file="$2"
|
||||
collect_mysql_status "$TMPDIR/defer_gatherer"
|
||||
cat "$TMPDIR/defer_gatherer" | join "$status_file" - > "$defer_file"
|
||||
}
|
||||
|
||||
collect_internal_vars () {
|
||||
local file="$1"
|
||||
|
||||
local FNV_64=""
|
||||
if $CMD_MYSQL $EXT_ARGV -e 'SELECT FNV_64("a")' >/dev/null 2>&1; then
|
||||
FNV_64="Enabled";
|
||||
else
|
||||
FNV_64="Unknown";
|
||||
fi
|
||||
|
||||
local now="$($CMD_MYSQL $EXT_ARGV -ss -e 'SELECT NOW()')"
|
||||
local user="$($CMD_MYSQL $EXT_ARGV -ss -e 'SELECT CURRENT_USER()')"
|
||||
local trigger_count=$($CMD_MYSQL $EXT_ARGV -ss -e "SELECT COUNT(*) FROM INFORMATION_SCHEMA.TRIGGERS" 2>/dev/null)
|
||||
local has_symbols="$(has_symbols "${CMD_MYSQL}")"
|
||||
|
||||
echo "pt-summary-internal-now $now" >> "$file"
|
||||
echo "pt-summary-internal-user $user" >> "$file"
|
||||
echo "pt-summary-internal-FNV_64 $FNV_64" >> "$file"
|
||||
echo "pt-summary-internal-trigger_count $trigger_count" >> "$file"
|
||||
echo "pt-summary-internal-symbols $has_symbols" >> "$file"
|
||||
}
|
||||
|
||||
collect_mysql_info () {
|
||||
local dir="$1"
|
||||
local prefix="$2"
|
||||
|
||||
collect_mysqld_instances "$dir/${prefix}-mysqld-instances"
|
||||
|
||||
collect_mysql_variables "$dir/${prefix}-mysql-variables"
|
||||
collect_mysql_status "$dir/${prefix}-mysql-status"
|
||||
collect_mysql_databases "$dir/${prefix}-mysql-databases"
|
||||
collect_mysql_plugins "$dir/${prefix}-mysql-plugins"
|
||||
collect_mysql_slave_status "$dir/${prefix}-mysql-slave"
|
||||
collect_mysql_innodb_status "$dir/${prefix}-innodb-status"
|
||||
collect_mysql_processlist "$dir/${prefix}-mysql-processlist"
|
||||
collect_mysql_users "$dir/${prefix}-mysql-users"
|
||||
|
||||
local binlog="$(get_var log_bin "$dir/${prefix}-mysql-variables")"
|
||||
if [ "${binlog}" ]; then
|
||||
_d "Got a binlog, going to get MASTER LOGS and MASTER STATUS"
|
||||
collect_master_logs_status "$dir/${prefix}-mysql-master-logs" "$dir/${prefix}-mysql-master-status"
|
||||
fi
|
||||
|
||||
local uptime="$(get_var Uptime "$dir/${prefix}-mysql-status")"
|
||||
local current_time="$($CMD_MYSQL $EXT_ARGV -ss -e \
|
||||
"SELECT LEFT(NOW() - INTERVAL ${uptime} SECOND, 16)")"
|
||||
|
||||
local port="$(get_var port "$dir/${prefix}-mysql-variables")"
|
||||
local cnf_file=$(find_my_cnf_file "$dir/${prefix}-mysqld-instances" ${port});
|
||||
|
||||
# TODO: Do these require a file of their own?
|
||||
echo "pt-summary-internal-current_time $current_time" >> "$dir/${prefix}-mysql-variables"
|
||||
echo "pt-summary-internal-Config_File $cnf_file" >> "$dir/${prefix}-mysql-variables"
|
||||
collect_internal_vars "$dir/${prefix}-mysql-variables"
|
||||
|
||||
if [ -n "${OPT_DUMP_SCHEMAS}" ]; then
|
||||
_d "--dump-schemas passed in, dumping early"
|
||||
local trg_arg="$( get_mysqldump_args "$dir/${prefix}-mysql-variables" )"
|
||||
get_mysqldump_for "$dir/${prefix}-mysqldump" "${trg_arg}" "${OPT_DUMP_SCHEMAS}"
|
||||
fi
|
||||
|
||||
# TODO: gather this data in the same format as normal: TS line, stats
|
||||
(
|
||||
sleep $OPT_SLEEP
|
||||
collect_mysql_deferred_status "$dir/${prefix}-mysql-status" "$dir/${prefix}-mysql-status-defer"
|
||||
) &
|
||||
_d "Forked child is $!"
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End collect_mysql_info package
|
||||
# ###########################################################################
|
456
lib/bash/collect_system_info.sh
Normal file
456
lib/bash/collect_system_info.sh
Normal file
@@ -0,0 +1,456 @@
|
||||
# This program is copyright 2011-2012 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# collect_system_info package
|
||||
# ###########################################################################
|
||||
|
||||
# Package: collect_system_info
|
||||
# collects system information.
|
||||
|
||||
# XXX
|
||||
# THIS LIB REQUIRES log_warn_die.sh, summary_common.sh, and alt_cmds.sh!
|
||||
# XXX
|
||||
|
||||
|
||||
# While extremely unwieldly, this allows us to fake the commands when testing.
|
||||
CMD_SYSCTL="$(_which sysctl 2>/dev/null )"
|
||||
CMD_DMIDECODE="$(_which dmidecode 2>/dev/null )"
|
||||
CMD_ZONENAME="$(_which zonename 2>/dev/null )"
|
||||
CMD_DMESG="$(_which dmesg 2>/dev/null )"
|
||||
CMD_FILE="$(_which file 2>/dev/null )"
|
||||
CMD_LSPCI="$(_which lspci 2>/dev/null )"
|
||||
CMD_PRTDIAG="$(_which prtdiag 2>/dev/null )"
|
||||
CMD_SMBIOS="$(_which smbios 2>/dev/null )"
|
||||
CMD_GETENFORCE="$(_which getenforce 2>/dev/null )"
|
||||
CMD_PRTCONF="$(_which prtconf 2>/dev/null )"
|
||||
CMD_LVS="$(_which lvs 2>/dev/null)"
|
||||
CMD_VGS="$(_which vgs 2>/dev/null)"
|
||||
CMD_PRSTAT="$(_which prstat 2>/dev/null)"
|
||||
CMD_TOP="$(_which top 2>/dev/null)"
|
||||
CMD_VMSTAT="$(_which vmstat 2>/dev/null)"
|
||||
CMD_IP="$( _which ip 2>/dev/null )"
|
||||
CMD_NETSTAT="$( _which netstat 2>/dev/null )"
|
||||
|
||||
collect_system_data () {
|
||||
local data_dir="$1"
|
||||
|
||||
if [ -r /var/log/dmesg -a -s /var/log/dmesg ]; then
|
||||
cat "/var/log/dmesg" > "$data_dir/dmesg_file"
|
||||
fi
|
||||
|
||||
# ########################################################################
|
||||
# Grab a bunch of stuff and put it into temp files for later.
|
||||
# ########################################################################
|
||||
$CMD_SYSCTL -a > "$data_dir/sysctl" 2>/dev/null
|
||||
|
||||
if [ -n "${CMD_LSPCI}" ]; then
|
||||
$CMD_LSPCI > "$data_dir/lspci_file" 2>/dev/null
|
||||
fi
|
||||
|
||||
local platform="$(uname -s)"
|
||||
echo "platform $platform" >> "$data_dir/summary"
|
||||
echo "hostname $(uname -n)" >> "$data_dir/summary"
|
||||
echo "uptime $(uptime | awk '{print substr($0, index($0, "up") + 3)}')" >> "$data_dir/summary"
|
||||
|
||||
processor_info "$data_dir"
|
||||
find_release_and_kernel "$data_dir/summary" "$platform"
|
||||
cpu_and_os_arch "$data_dir/summary" "$platform"
|
||||
find_virtualization "$data_dir/summary" "$platform" "$data_dir/dmesg_file" "$data_dir/lspci_file"
|
||||
dmidecode_system_info "$data_dir/summary"
|
||||
|
||||
if [ "${platform}" = "SunOS" ]; then
|
||||
if [ -n "${CMD_ZONENAME}" ]; then
|
||||
echo "zonename $($CMD_ZONENAME)" >> "$data_dir/summary"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Threading library
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
echo "threading $(getconf GNU_LIBPTHREAD_VERSION)" >> "$data_dir/summary"
|
||||
fi
|
||||
if [ -x /lib/libc.so.6 ]; then
|
||||
echo "compiler $(/lib/libc.so.6 | grep 'Compiled by' | cut -c13-)" >> "$data_dir/summary"
|
||||
fi
|
||||
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
local getenforce=""
|
||||
if [ -n "$CMD_GETENFORCE" ]; then
|
||||
getenforce="$($CMD_GETENFORCE 2>&1)";
|
||||
fi
|
||||
echo "getenforce ${getenforce:-No SELinux detected}" >> "$data_dir/summary"
|
||||
fi
|
||||
|
||||
local rss=$(ps -eo rss 2>/dev/null | awk '/[0-9]/{total += $1 * 1024} END {print total}')
|
||||
echo "rss ${rss}" >> "$data_dir/summary"
|
||||
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
echo "swappiness $(awk '/vm.swappiness/{print $3}' "$data_dir/sysctl")">> "$data_dir/summary"
|
||||
echo "dirtypolicy $(awk '/vm.dirty_ratio/{print $3}' "$data_dir/sysctl"), $(awk '/vm.dirty_background_ratio/{print $3}' "$data_dir/sysctl")" >> "$data_dir/summary"
|
||||
if $(awk '/vm.dirty_bytes/{print $3}' "$data_dir/sysctl") > /dev/null 2>&1; then
|
||||
echo "dirtystatus $(awk '/vm.dirty_bytes/{print $3}' "$data_dir/sysctl"), $(awk '/vm.dirty_background_bytes/{print $3}' "$data_dir/sysctl")" >> "$data_dir/summary"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$CMD_DMIDECODE" ]; then
|
||||
$CMD_DMIDECODE > "$data_dir/dmidecode" 2>/dev/null
|
||||
fi
|
||||
|
||||
find_memory_stats "$data_dir/memory" "$platform"
|
||||
mounted_fs_info "$data_dir/mounted_fs" "$platform" "$PT_SUMMARY_SKIP"
|
||||
raid_controller "$data_dir/summary" "$data_dir/dmesg_file" "$data_dir/lspci_file"
|
||||
|
||||
local controller="$(get_var raid_controller "$data_dir/summary")"
|
||||
propietary_raid_controller "$data_dir/raid-controller" "$data_dir/summary" "$data_dir" "$controller"
|
||||
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
schedulers_and_queue_size "$data_dir/summary" "$data_dir/partitioning"
|
||||
for file in dentry-state file-nr inode-nr; do
|
||||
echo "${file} $(cat /proc/sys/fs/${file} 2>&1)" >> "$data_dir/summary"
|
||||
done
|
||||
|
||||
if [ -n "$CMD_LVS" ] && test -x "$CMD_LVS"; then
|
||||
$CMD_LVS 1>"$data_dir/lvs" 2>&1
|
||||
fi
|
||||
|
||||
if [ -n "$CMD_VGS" ] && test -x "$CMD_VGS"; then
|
||||
$CMD_VGS -o vg_name,vg_size,vg_free 2>/dev/null > "$data_dir/vgs"
|
||||
fi
|
||||
|
||||
if [ -n "$CMD_NETSTAT" ] && echo "${PT_SUMMARY_SKIP}" | grep -v NETWORK >/dev/null; then
|
||||
$CMD_NETSTAT -antp > "$data_dir/netstat" 2>/dev/null
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ -n "$CMD_IP" ] && echo "${PT_SUMMARY_SKIP}" | grep -v NETWORK >/dev/null; then
|
||||
$CMD_IP -s link > "$data_dir/ip"
|
||||
fi
|
||||
|
||||
top_processes "$data_dir/processes" "$PT_SUMMARY_SKIP"
|
||||
notable_processes_info "$data_dir/notable_procs" "$PT_SUMMARY_SKIP"
|
||||
|
||||
if [ -n "$CMD_VMSTAT" ]; then
|
||||
touch "$data_dir/vmstat"
|
||||
(
|
||||
$CMD_VMSTAT 1 $OPT_SLEEP > "$data_dir/vmstat"
|
||||
) &
|
||||
fi
|
||||
}
|
||||
|
||||
# Try to find all sorts of different files that say what the release is.
|
||||
find_release_and_kernel () {
|
||||
local file="$1"
|
||||
local platform="$2"
|
||||
|
||||
local kernel=""
|
||||
local release=""
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
kernel="$(uname -r)"
|
||||
if [ -e /etc/fedora-release ]; then
|
||||
release=$(cat /etc/fedora-release);
|
||||
elif [ -e /etc/redhat-release ]; then
|
||||
release=$(cat /etc/redhat-release);
|
||||
elif [ -e /etc/system-release ]; then
|
||||
release=$(cat /etc/system-release);
|
||||
elif _which lsb_release >/dev/null 2>&1; then
|
||||
release="$(lsb_release -ds) ($(lsb_release -cs))"
|
||||
elif [ -e /etc/lsb-release ]; then
|
||||
release=$(grep DISTRIB_DESCRIPTION /etc/lsb-release |awk -F'=' '{print $2}' |sed 's#"##g');
|
||||
elif [ -e /etc/debian_version ]; then
|
||||
release="Debian-based version $(cat /etc/debian_version)";
|
||||
if [ -e /etc/apt/sources.list ]; then
|
||||
local code=` awk '/^deb/ {print $3}' /etc/apt/sources.list \
|
||||
| awk -F/ '{print $1}'| awk 'BEGIN {FS="|"}{print $1}' \
|
||||
| sort | uniq -c | sort -rn | head -n1 | awk '{print $2}'`
|
||||
release="${release} (${code})"
|
||||
fi
|
||||
elif ls /etc/*release >/dev/null 2>&1; then
|
||||
if grep -q DISTRIB_DESCRIPTION /etc/*release; then
|
||||
release=$(grep DISTRIB_DESCRIPTION /etc/*release | head -n1);
|
||||
else
|
||||
release=$(cat /etc/*release | head -n1);
|
||||
fi
|
||||
fi
|
||||
elif [ "${platform}" = "FreeBSD" ]; then
|
||||
release="$(uname -r)"
|
||||
kernel="$($CMD_SYSCTL -n kern.osrevision)"
|
||||
elif [ "${platform}" = "SunOS" ]; then
|
||||
release="$(head -n1 /etc/release)"
|
||||
if [ -z "${release}" ]; then
|
||||
release="$(uname -r)"
|
||||
fi
|
||||
kernel="$(uname -v)"
|
||||
fi
|
||||
echo "kernel $kernel" >> "$file"
|
||||
echo "release $release" >> "$file"
|
||||
}
|
||||
|
||||
cpu_and_os_arch () {
|
||||
local file="$1"
|
||||
local platform="$2"
|
||||
|
||||
local CPU_ARCH='32-bit'
|
||||
local OS_ARCH='32-bit'
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
if [ "$(grep -q ' lm ' /proc/cpuinfo)" ]; then
|
||||
CPU_ARCH='64-bit'
|
||||
fi
|
||||
elif [ "${platform}" = "FreeBSD" ]; then
|
||||
if $CMD_SYSCTL hw.machine_arch | grep -v 'i[36]86' >/dev/null; then
|
||||
CPU_ARCH='64-bit'
|
||||
fi
|
||||
elif [ "${platform}" = "SunOS" ]; then
|
||||
if isainfo -b | grep 64 >/dev/null ; then
|
||||
CPU_ARCH="64-bit"
|
||||
fi
|
||||
fi
|
||||
if [ -z "$CMD_FILE" ]; then
|
||||
OS_ARCH='N/A'
|
||||
elif $CMD_FILE /bin/sh | grep '64-bit' >/dev/null; then
|
||||
OS_ARCH='64-bit'
|
||||
fi
|
||||
|
||||
echo "CPU_ARCH $CPU_ARCH" >> "$file"
|
||||
echo "OS_ARCH $OS_ARCH" >> "$file"
|
||||
}
|
||||
|
||||
# We look in dmesg for virtualization information first, because it's often
|
||||
# available to non-root users and usually has telltale signs. It's most
|
||||
# reliable to look at /var/log/dmesg if possible. There are a number of
|
||||
# other ways to find out if a system is virtualized.
|
||||
find_virtualization () {
|
||||
local vars_file="$1"
|
||||
local platform="$2"
|
||||
local dmesg_file="$3"
|
||||
local lspci_file="$4"
|
||||
|
||||
local tempfile="$TMPDIR/find_virtualziation.tmp"
|
||||
|
||||
local virt=""
|
||||
if [ -s "$dmesg_file" ]; then
|
||||
virt="$(parse_virtualization_dmesg "$dmesg_file")"
|
||||
fi
|
||||
if [ -z "${virt}" ] && [ -s "$lspci_file" ]; then
|
||||
if grep -qi virtualbox "$lspci_file" ; then
|
||||
virt=VirtualBox
|
||||
elif grep -qi vmware "$lspci_file" ; then
|
||||
virt=VMWare
|
||||
fi
|
||||
elif [ "${platform}" = "FreeBSD" ]; then
|
||||
if ps -o stat | grep J ; then
|
||||
virt="FreeBSD Jail"
|
||||
fi
|
||||
elif [ "${platform}" = "SunOS" ]; then
|
||||
if [ -n "$CMD_PRTDIAG" ] && $CMD_PRTDIAG > "$tempfile" 2>/dev/null; then
|
||||
virt="$(parse_virtualization_generic "$tempfile" )"
|
||||
elif [ -n "$CMD_SMBIOS" ] && $CMD_SMBIOS > "$tempfile" 2>/dev/null; then
|
||||
virt="$(parse_virtualization_generic "$tempfile" )"
|
||||
fi
|
||||
elif [ -e /proc/user_beancounters ]; then
|
||||
virt="OpenVZ/Virtuozzo"
|
||||
fi
|
||||
echo "virt ${virt:-No virtualization detected}" >> "$vars_file"
|
||||
}
|
||||
|
||||
# TODO: Maybe worth it to just dump dmidecode once and parse that?
|
||||
dmidecode_system_info () {
|
||||
local file="$1"
|
||||
if [ -n "${CMD_DMIDECODE}" ]; then
|
||||
local vendor="$($CMD_DMIDECODE -s system-manufacturer 2>/dev/null | sed 's/ *$//g')"
|
||||
echo "vendor ${vendor}" >> "$file"
|
||||
if [ "${vendor}" ]; then
|
||||
local product="$($CMD_DMIDECODE -s system-product-name 2>/dev/null | sed 's/ *$//g')"
|
||||
local version="$($CMD_DMIDECODE -s system-version 2>/dev/null | sed 's/ *$//g')"
|
||||
local chassis="$($CMD_DMIDECODE -s chassis-type 2>/dev/null | sed 's/ *$//g')"
|
||||
local servicetag="$($CMD_DMIDECODE -s system-serial-number 2>/dev/null | sed 's/ *$//g')"
|
||||
local system="${vendor}; ${product}; v${version} (${chassis})"
|
||||
|
||||
echo "system ${system}" >> "$file"
|
||||
echo "servicetag ${servicetag:-Not found}" >> "$file"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
find_memory_stats () {
|
||||
local file="$1"
|
||||
local platform="$2"
|
||||
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
free -b > "$file"
|
||||
cat /proc/meminfo >> "$file"
|
||||
elif [ "${platform}" = "SunOS" ]; then
|
||||
$CMD_PRTCONF | awk -F: '/Memory/{print $2}' > "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
mounted_fs_info () {
|
||||
local file="$1"
|
||||
local platform="$2"
|
||||
local skip="${3:-$PT_SUMMARY_SKIP}"
|
||||
|
||||
if echo "${skip}" | grep -v MOUNT >/dev/null; then
|
||||
if [ "${platform}" != "SunOS" ]; then
|
||||
local cmd="df -h"
|
||||
if [ "${platform}" = "Linux" ]; then
|
||||
cmd="df -h -P"
|
||||
fi
|
||||
$cmd | sort > "$TMPDIR/mounted_fs_info.tmp"
|
||||
mount | sort | join "$TMPDIR/mounted_fs_info.tmp" - > "$file"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# ########################################################################
|
||||
# We look in lspci first because it's more reliable, then dmesg, because it's
|
||||
# often available to non-root users. It's most reliable to look at
|
||||
# /var/log/dmesg if possible.
|
||||
# ########################################################################
|
||||
raid_controller () {
|
||||
local file="$1"
|
||||
local dmesg_file="$2"
|
||||
local lspci_file="$3"
|
||||
|
||||
local tempfile="$TMPDIR/raid_controller.tmp"
|
||||
|
||||
local controller=""
|
||||
if [ -s "$lspci_file" ]; then
|
||||
controller="$(parse_raid_controller_lspci "$lspci_file")"
|
||||
fi
|
||||
if [ -z "${controller}" ] && [ -s "$dmesg_file" ]; then
|
||||
controller="$(parse_raid_controller_dmesg "$dmesg_file")"
|
||||
fi
|
||||
|
||||
echo "raid_controller ${controller:-No RAID controller detected}" >> "$file"
|
||||
}
|
||||
|
||||
schedulers_and_queue_size () {
|
||||
local file="$1"
|
||||
local disk_partitioning_file="$2"
|
||||
|
||||
local disks="$(ls /sys/block/ | grep -v -e ram -e loop -e 'fd[0-9]')"
|
||||
echo "disks $disks" >> "$file"
|
||||
echo "" > "$disk_partitioning_file"
|
||||
for disk in $disks; do
|
||||
if [ -e "/sys/block/${disk}/queue/scheduler" ]; then
|
||||
echo "internal::${disk} $(cat /sys/block/${disk}/queue/scheduler | grep -o '\[.*\]') $(cat /sys/block/${disk}/queue/nr_requests)" >> "$file"
|
||||
fdisk -l "/dev/${disk}" >> "$disk_partitioning_file" 2>/dev/null
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
top_processes () {
|
||||
local top_processes_file="$1"
|
||||
local skip="${2:-"$PT_SUMMARY_SKIP"}"
|
||||
|
||||
if echo "${skip}" | grep -v PROCESS >/dev/null; then
|
||||
if [ -n "$CMD_PRSTAT" ]; then
|
||||
$CMD_PRSTAT | head > "$top_processes_file"
|
||||
elif [ -n "$CMD_TOP" ]; then
|
||||
local cmd="$CMD_TOP -bn 1"
|
||||
if [ "${platform}" = "FreeBSD" ]; then
|
||||
cmd="$CMD_TOP -b -d 1"
|
||||
fi
|
||||
$cmd | sed -e 's# *$##g' -e '/./{H;$!d;}' -e 'x;/PID/!d;' | grep . | head > "$top_processes_file"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
notable_processes_info () {
|
||||
local notable_processes_file="$1"
|
||||
local skip="${2:-"$PT_SUMMARY_SKIP"}"
|
||||
|
||||
if echo "${skip}" | grep -v PROCESS >/dev/null; then
|
||||
local sshd_pid=$(_pidof sshd)
|
||||
|
||||
echo " PID OOM COMMAND" > "$notable_processes_file"
|
||||
|
||||
# First, let's find the oom value of sshd
|
||||
if [ "$sshd_pid" ]; then
|
||||
echo "$sshd_pid $(get_oom_of_pid $sshd_pid) sshd" >> "$notable_processes_file"
|
||||
else
|
||||
_d "sshd doesn't appear to be running"
|
||||
fi
|
||||
|
||||
# Now, let's find if any process has an oom value of -17
|
||||
ps -eo pid,ucomm | tail -n +2 | while read pid proc; do
|
||||
[ "$proc" = "sshd" ] && continue
|
||||
local oom=$(get_oom_of_pid $pid)
|
||||
if [ "$oom" ] && [ "$oom" != "?" ] && [ "$oom" -eq -17 ]; then
|
||||
printf "%5s %+2d %s\n" $pid $oom $proc >> "$notable_processes_file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
processor_info () {
|
||||
local data_dir="$1"
|
||||
if [ -f /proc/cpuinfo ]; then
|
||||
cat /proc/cpuinfo > "$data_dir/proc_cpuinfo_copy" 2>/dev/null
|
||||
elif [ "${platform}" = "SunOS" ]; then
|
||||
psrinfo -v > "$data_dir/psrinfo_minus_v"
|
||||
fi
|
||||
}
|
||||
|
||||
# ########################################################################
|
||||
# Attempt to get, parse, and print RAID controller status from possibly
|
||||
# proprietary management software. Any executables that are normally stored
|
||||
# in a weird location, such as /usr/StorMan/arcconf, should have their
|
||||
# location added to $PATH at the beginning of main().
|
||||
# ########################################################################
|
||||
propietary_raid_controller () {
|
||||
local file="$1"
|
||||
local variable_file="$2"
|
||||
local data_dir="$3"
|
||||
local controller="$4"
|
||||
|
||||
rm -f "$file"
|
||||
touch "$file"
|
||||
|
||||
notfound=""
|
||||
if [ "${controller}" = "AACRAID" ]; then
|
||||
if ! _which arcconf >/dev/null 2>&1; then
|
||||
notfound="e.g. http://www.adaptec.com/en-US/support/raid/scsi_raid/ASR-2120S/"
|
||||
elif arcconf getconfig 1 > "$file" 2>/dev/null; then
|
||||
echo "internal::raid_opt 1" >> "$variable_file"
|
||||
fi
|
||||
elif [ "${controller}" = "HP Smart Array" ]; then
|
||||
if ! _which hpacucli >/dev/null 2>&1; then
|
||||
notfound="your package repository or the manufacturer's website"
|
||||
elif hpacucli ctrl all show config > "$file" 2>/dev/null; then
|
||||
echo "internal::raid_opt 2" >> "$variable_file"
|
||||
fi
|
||||
elif [ "${controller}" = "LSI Logic MegaRAID SAS" ]; then
|
||||
if ! _which MegaCli64 >/dev/null 2>&1; then
|
||||
notfound="your package repository or the manufacturer's website"
|
||||
else
|
||||
echo "internal::raid_opt 3" >> "$variable_file"
|
||||
MegaCli64 -AdpAllInfo -aALL -NoLog > "$data_dir/lsi_megaraid_adapter_info.tmp" 2>/dev/null
|
||||
MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL -NoLog > "$data_dir/lsi_megaraid_bbu_status.tmp" 2>/dev/null
|
||||
MegaCli64 -LdPdInfo -aALL -NoLog > "$data_dir/lsi_megaraid_devices.tmp" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${notfound}" ]; then
|
||||
echo "internal::raid_opt 0" >> "$variable_file"
|
||||
echo " RAID controller software not found; try getting it from" > "$file"
|
||||
echo " ${notfound}" >> "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End collect_system_info package
|
||||
# ###########################################################################
|
@@ -24,6 +24,7 @@
|
||||
set -u
|
||||
|
||||
# Global variables.
|
||||
PTDEBUG="${PTDEBUG:-""}"
|
||||
EXIT_STATUS=0
|
||||
|
||||
log() {
|
||||
@@ -41,6 +42,10 @@ die() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
_d () {
|
||||
[ "$PTDEBUG" ] && echo "# $(log "$@")" >&2
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End log_warn_die package
|
||||
# ###########################################################################
|
||||
|
113
lib/bash/report_formatting.sh
Normal file
113
lib/bash/report_formatting.sh
Normal file
@@ -0,0 +1,113 @@
|
||||
# This program is copyright 2011 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# report_formatting package
|
||||
# ###########################################################################
|
||||
|
||||
# Package: report_formatting
|
||||
# Common report formatting functions for the summary tools.
|
||||
|
||||
set -u
|
||||
|
||||
POSIXLY_CORRECT=1
|
||||
export POSIXLY_CORRECT
|
||||
|
||||
fuzzy_formula='
|
||||
rounded = 0;
|
||||
if (fuzzy_var <= 10 ) {
|
||||
rounded = 1;
|
||||
}
|
||||
factor = 1;
|
||||
while ( rounded == 0 ) {
|
||||
if ( fuzzy_var <= 50 * factor ) {
|
||||
fuzzy_var = sprintf("%.0f", fuzzy_var / (5 * factor)) * 5 * factor;
|
||||
rounded = 1;
|
||||
}
|
||||
else if ( fuzzy_var <= 100 * factor) {
|
||||
fuzzy_var = sprintf("%.0f", fuzzy_var / (10 * factor)) * 10 * factor;
|
||||
rounded = 1;
|
||||
}
|
||||
else if ( fuzzy_var <= 250 * factor) {
|
||||
fuzzy_var = sprintf("%.0f", fuzzy_var / (25 * factor)) * 25 * factor;
|
||||
rounded = 1;
|
||||
}
|
||||
factor = factor * 10;
|
||||
}'
|
||||
|
||||
# Does fuzzy rounding: rounds to nearest interval, but the interval gets larger
|
||||
# as the number gets larger. This is to make things easier to diff.
|
||||
fuzz () {
|
||||
_d "fuzz: $1"
|
||||
echo $1 | awk "{fuzzy_var=\$1; ${fuzzy_formula} print fuzzy_var;}"
|
||||
}
|
||||
|
||||
# Fuzzy computes the percent that $1 is of $2
|
||||
fuzzy_pct () {
|
||||
local pct="$(echo $1 $2 | awk '{ if ($2 > 0) { printf "%d", $1/$2*100; } else {print 0} }')";
|
||||
echo "$(fuzz "${pct}")%"
|
||||
}
|
||||
|
||||
# Prints a section header. All spaces in the string passed in are replaced
|
||||
# with #'s and all underscores with spaces.
|
||||
section () {
|
||||
local str="$1"
|
||||
local line="$(printf '#_%-60s' "${str}_" | sed -e 's/[[:space:]]/#/g' -e 's/_/ /g')"
|
||||
printf "%s\n" "${line}"
|
||||
}
|
||||
|
||||
NAME_VAL_LEN=12
|
||||
name_val () {
|
||||
# We use $NAME_VAL_LEN here because the two summary tools, as well as
|
||||
# the tests, use diffent widths.
|
||||
printf "%+*s | %s\n" "${NAME_VAL_LEN}" "$1" "$2"
|
||||
}
|
||||
|
||||
# Sub: shorten
|
||||
# Shorten a value in bytes to another representation.
|
||||
#
|
||||
shorten() {
|
||||
local num="$1"
|
||||
local prec="${2:-2}"
|
||||
local div="${3:-1024}"
|
||||
|
||||
echo "$num" | awk -v prec="$prec" -v div="$div" '
|
||||
{
|
||||
size = 4;
|
||||
val = $1;
|
||||
|
||||
unit = val >= 1099511627776 ? "T" : val >= 1073741824 ? "G" : val >= 1048576 ? "M" : val >= 1024 ? "k" : "";
|
||||
|
||||
while ( int(val) && !(val % 1024) ) {
|
||||
val /= 1024;
|
||||
}
|
||||
|
||||
while ( val > 1000 ) {
|
||||
val /= div;
|
||||
}
|
||||
|
||||
printf "%.*f%s", prec, val, unit;
|
||||
}
|
||||
'
|
||||
}
|
||||
|
||||
group_concat () {
|
||||
sed -e '{H; $!d;}' -e 'x' -e 's/\n[[:space:]]*\([[:digit:]]*\)[[:space:]]*/, \1x/g' -e 's/[[:space:]][[:space:]]*/ /g' -e 's/, //' "${1}"
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End report_formatting package
|
||||
# ###########################################################################
|
157
lib/bash/summary_common.sh
Normal file
157
lib/bash/summary_common.sh
Normal file
@@ -0,0 +1,157 @@
|
||||
# This program is copyright 2011-2012 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# summary_common package
|
||||
# ###########################################################################
|
||||
|
||||
# Package: summary_common
|
||||
# Common functions between the summary packages.
|
||||
|
||||
set -u
|
||||
|
||||
# Tries to find the niceness of the passed in PID. First with ps, and
|
||||
# failing that, with a bit of C, using getpriority().
|
||||
# Returns the nice for the pid, or "?" if it can't find any.
|
||||
get_nice_of_pid () {
|
||||
local pid="$1"
|
||||
local niceness=$(ps -p $pid -o nice | tail -n+2 | awk '{print $1; exit;}')
|
||||
|
||||
if [ -n "${niceness}" ]; then
|
||||
echo $niceness
|
||||
else
|
||||
local tmpfile="$TMPDIR/nice_through_c.tmp.c"
|
||||
_d "Getting the niceness from ps failed, somehow. We are about to try this:"
|
||||
cat <<EOC > "$tmpfile"
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int priority = getpriority(PRIO_PROCESS, $pid);
|
||||
if ( priority == -1 && errno == ESRCH ) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
printf("%d\\n", priority);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
EOC
|
||||
local c_comp=$(_which gcc)
|
||||
if [ -z "${c_comp}" ]; then
|
||||
c_comp=$(_which cc)
|
||||
fi
|
||||
_d "$tmpfile: $( cat "$tmpfile" )"
|
||||
_d "$c_comp -xc \"$tmpfile\" -o \"$tmpfile\" && eval \"$tmpfile\""
|
||||
$c_comp -xc "$tmpfile" -o "$tmpfile" 2>/dev/null && eval "$tmpfile" 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "?"
|
||||
_d "Failed to get a niceness value for $pid"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Fetches the oom value for a given pid.
|
||||
# To avoi deprecation warnings, tries /proc/PID/oom_score_adj first.
|
||||
# Will only work if /proc/cpuinfo is available.
|
||||
get_oom_of_pid () {
|
||||
local pid="$1"
|
||||
local oom_adj=""
|
||||
|
||||
if [ -n "${pid}" ] && [ -e /proc/cpuinfo ]; then
|
||||
if [ -s "/proc/$pid/oom_score_adj" ]; then
|
||||
oom_adj=$(cat "/proc/$pid/oom_score_adj" 2>/dev/null)
|
||||
_d "For $pid, the oom value is $oom_adj, retreived from oom_score_adj"
|
||||
else
|
||||
oom_adj=$(cat "/proc/$pid/oom_adj" 2>/dev/null)
|
||||
_d "For $pid, the oom value is $oom_adj, retreived from oom_adj"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${oom_adj}" ]; then
|
||||
echo "${oom_adj}"
|
||||
else
|
||||
echo "?"
|
||||
_d "Can't find the oom value for $pid"
|
||||
fi
|
||||
}
|
||||
|
||||
CMD_FILE="$( _which file 2>/dev/null )"
|
||||
CMD_NM="$( _which nm 2>/dev/null )"
|
||||
CMD_OBJDUMP="$( _which objdump 2>/dev/null )"
|
||||
|
||||
has_symbols () {
|
||||
local executable="$(_which "$1")"
|
||||
local has_symbols=""
|
||||
|
||||
if [ "${CMD_FILE}" ] \
|
||||
&& [ "$($CMD_FILE "${executable}" | grep 'not stripped' )" ]; then
|
||||
has_symbols=1
|
||||
elif [ "${CMD_NM}" ] \
|
||||
|| [ "${CMD_OBJDMP}" ]; then
|
||||
if [ "${CMD_NM}" ] \
|
||||
&& [ !"$("${CMD_NM}" -- "${executable}" 2>&1 | grep 'File format not recognized' )" ]; then
|
||||
if [ -z "$( $CMD_NM -- "${executable}" 2>&1 | grep ': no symbols' )" ]; then
|
||||
has_symbols=1
|
||||
fi
|
||||
elif [ -z "$("${CMD_OBJDUMP}" -t -- "${executable}" | grep '^no symbols$' )" ]; then
|
||||
has_symbols=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${has_symbols}" ]; then
|
||||
echo "Yes"
|
||||
return 0
|
||||
else
|
||||
echo "No"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_data_dir () {
|
||||
local data_dir=""
|
||||
if [ -z "$OPT_SAVE_DATA" ]; then
|
||||
# User didn't specify a --save-data dir, so use a sub-dir in our tmpdir.
|
||||
mkdir "$TMPDIR/data" || die "Cannot mkdir $TMPDIR/data"
|
||||
data_dir="$TMPDIR/data"
|
||||
else
|
||||
# Check the user's --save-data dir.
|
||||
if [ ! -d "$OPT_SAVE_DATA" ]; then
|
||||
mkdir "$OPT_SAVE_DATA" || die "Cannot mkdir $OPT_SAVE_DATA"
|
||||
fi
|
||||
touch "$OPT_SAVE_DATA/test" || die "Cannot write to $OPT_SAVE_DATA"
|
||||
rm "$OPT_SAVE_DATA/test" || die "Cannot rm $OPT_SAVE_DATA/test"
|
||||
data_dir="$OPT_SAVE_DATA"
|
||||
fi
|
||||
echo "$data_dir"
|
||||
}
|
||||
|
||||
# gets a value from the passed in file. Returns _GET_VAR_DEFAULT if it doesn't
|
||||
# exist, which unless changed is 0.
|
||||
_GET_VAR_DEFAULT=0
|
||||
get_var () {
|
||||
local varname="$1"
|
||||
local file="$2"
|
||||
local v="$(awk "\$1 ~ /^${varname}$/ { print \$2 }" "${file}")"
|
||||
echo "${v:-$_GET_VAR_DEFAULT}"
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End summary_common package
|
||||
# ###########################################################################
|
51
t/lib/bash/collect_mysql_info.sh
Normal file
51
t/lib/bash/collect_mysql_info.sh
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 3
|
||||
|
||||
TMPDIR="$TEST_TMPDIR"
|
||||
PATH="$PATH:$PERCONA_TOOLKIT_SANDBOX/bin"
|
||||
TOOL="pt-mysql-summary"
|
||||
|
||||
. "$LIB_DIR/log_warn_die.sh"
|
||||
. "$LIB_DIR/alt_cmds.sh"
|
||||
. "$LIB_DIR/summary_common.sh"
|
||||
. "$LIB_DIR/collect_mysql_info.sh"
|
||||
|
||||
# Prefix (with path) for the collect files.
|
||||
local p="$TMPDIR/collect_mysql_info"
|
||||
|
||||
mkdir "$p"
|
||||
|
||||
parse_options "$BIN_DIR/pt-mysql-summary" --sleep 1 -- --defaults-file=/tmp/12345/my.sandbox.cnf
|
||||
|
||||
CMD_MYSQL="$(_which mysql)"
|
||||
CMD_MYSQLDUMP="$(_which mysqldump)"
|
||||
|
||||
collect_mysql_info "$p" 1>/dev/null
|
||||
wait
|
||||
|
||||
file_count=$(ls "$p" | wc -l)
|
||||
|
||||
is $file_count 12 "Creates the correct number of files (without --dump-schemas)"
|
||||
|
||||
grep -v grep "$p/percona-toolkit-mysqld-instances" | awk '{print $2}' > "$TMPDIR/collect_mysqld_instances1.test"
|
||||
ps auxww 2>/dev/null | grep mysqld | grep -v grep | awk '{print $2}' > "$TMPDIR/collect_mysqld_instances2.test"
|
||||
|
||||
no_diff \
|
||||
"$TMPDIR/collect_mysqld_instances1.test" \
|
||||
"$TMPDIR/collect_mysqld_instances2.test" \
|
||||
"collect_mysql_info() finds the correct instances"
|
||||
|
||||
collect_mysqld_instances "$TMPDIR/collect_mysqld_instances3.test"
|
||||
|
||||
no_diff \
|
||||
"$TMPDIR/collect_mysqld_instances3.test" \
|
||||
"$TMPDIR/collect_mysqld_instances2.test" \
|
||||
"(sanity check) which are the same that collect_mysqld_instances() does"
|
||||
|
||||
$CMD_MYSQL $EXT_ARGV -ss -e 'SHOW /*!50000 GLOBAL*/ STATUS' > "$TMPDIR/collect_mysql_status"
|
||||
no_diff \
|
||||
"$p/percona-toolkit-mysql-status" \
|
||||
"$TMPDIR/collect_mysql_status" \
|
||||
"collect_mysql_info() finds the correct instances"
|
||||
|
90
t/lib/bash/report_formatting.sh
Normal file
90
t/lib/bash/report_formatting.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 12
|
||||
|
||||
. "$LIB_DIR/report_formatting.sh"
|
||||
|
||||
is \
|
||||
"$(shorten 10485760 1)" \
|
||||
"10.0M" \
|
||||
"10485760, 1 precision, default divisor => 10.0M"
|
||||
|
||||
is \
|
||||
"$(shorten 3145728000 1)" \
|
||||
"2.9G" \
|
||||
"10485760, 1 precision, default divisor => 2.9G"
|
||||
|
||||
is \
|
||||
"$(shorten 3145728000 1 1000)" \
|
||||
"3.0G" \
|
||||
"Opt-in to the 2.1 behavior works"
|
||||
|
||||
is \
|
||||
"$(shorten 0 0)" \
|
||||
"0" \
|
||||
"0, 0 precision, default divisor => 0"
|
||||
|
||||
is \
|
||||
"$(shorten 1572864000 1)" \
|
||||
"1.5G" \
|
||||
"1572864000, 1 precision, default divisor => 1.5G"
|
||||
|
||||
is \
|
||||
"$(shorten 1572864000 1 1000)" \
|
||||
"1.5G" \
|
||||
"1572864000, 1 precision, divisor 1000 => 1.5G"
|
||||
|
||||
is \
|
||||
"$(shorten 364 0)" \
|
||||
"364" \
|
||||
"364, 0 precision, default divisor => 364"
|
||||
|
||||
is \
|
||||
"$(shorten 364 1)" \
|
||||
"364.0" \
|
||||
"364, 1 precision, default divisor => 364"
|
||||
|
||||
is \
|
||||
"$(shorten 649216 1)" \
|
||||
"634.0k" \
|
||||
"649216, 1 precision, default divisor => 634.0k"
|
||||
|
||||
is \
|
||||
"$(shorten 6492100000006 1)" \
|
||||
"5.9T" \
|
||||
"6492100000006, 1 precision, default divisor => 5.9T"
|
||||
|
||||
is \
|
||||
"$(shorten 6492100000006 1 1000)" \
|
||||
"6.5T" \
|
||||
"6492100000006, 1 precision, divisor 1000 => 6.5T"
|
||||
|
||||
# section
|
||||
|
||||
is \
|
||||
"$(section "A")" \
|
||||
"# A ##########################################################" \
|
||||
"Sanity check, section works"
|
||||
|
||||
is \
|
||||
"$(section "A B C")" \
|
||||
"# A#B#C ######################################################" \
|
||||
"section replaces all spaces with #s"
|
||||
|
||||
is \
|
||||
"$(section "A_B_C")" \
|
||||
"# A B C ######################################################" \
|
||||
"..and all underscores with spaces"
|
||||
|
||||
# name_val
|
||||
|
||||
NAME_VAL_LEN=0
|
||||
|
||||
is \
|
||||
"$(name_val "A" "B")" \
|
||||
"A | B" \
|
||||
"name_val and NAME_VAL_LEN work"
|
||||
|
||||
# ###########################################################################
|
||||
# Done
|
||||
# ###########################################################################
|
36
t/pt-mysql-summary/format_innodb.sh
Normal file
36
t/pt-mysql-summary/format_innodb.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#/bin/bash
|
||||
|
||||
TESTS=1
|
||||
TMPDIR=$TEST_TMPDIR
|
||||
|
||||
test_format_innodb () {
|
||||
local NAME_VAL_LEN=25
|
||||
cat <<EOF > $TMPDIR/expected
|
||||
Version | 1.0.17-13.2
|
||||
Buffer Pool Size | 128.0M
|
||||
Buffer Pool Fill | 1%
|
||||
Buffer Pool Dirty | 0%
|
||||
File Per Table | OFF
|
||||
Page Size | 16k
|
||||
Log File Size | 2 * 1.5G = 3.1G
|
||||
Log Buffer Size | 8M
|
||||
Flush Method | 0
|
||||
Flush Log At Commit | 1
|
||||
XA Support | ON
|
||||
Checksums | ON
|
||||
Doublewrite | ON
|
||||
R/W I/O Threads | 4 4
|
||||
I/O Capacity | 200
|
||||
Thread Concurrency | 0
|
||||
Concurrency Tickets | 500
|
||||
Commit Concurrency | 0
|
||||
Txn Isolation Level | REPEATABLE-READ
|
||||
Adaptive Flushing | OFF
|
||||
Adaptive Checkpoint | estimate
|
||||
EOF
|
||||
|
||||
_innodb samples/temp001/percona-toolkit-mysql-variables samples/temp001/percona-toolkit-mysql-status > $TMPDIR/got
|
||||
no_diff $TMPDIR/expected $TMPDIR/got
|
||||
}
|
||||
|
||||
test_format_innodb
|
@@ -12,7 +12,7 @@ cat <<EOF > $TMPDIR/expected
|
||||
2010-05-27 11:38 (up 0+02:08:52)
|
||||
EOF
|
||||
cp samples/mysql-status-001.txt $TMPDIR/percona-toolkit-mysql-status
|
||||
local uptime="$(get_stat Uptime $TMPDIR/percona-toolkit-mysql-status)"
|
||||
local uptime="$(get_var Uptime $TMPDIR/percona-toolkit-mysql-status)"
|
||||
local current_time="$(echo -e "2010-05-27 11:38\n")"
|
||||
get_mysql_uptime "${uptime}" "${current_time}" > $TMPDIR/got
|
||||
no_diff $TMPDIR/got $TMPDIR/expected
|
||||
|
@@ -23,22 +23,22 @@ use File::Temp qw( tempdir );
|
||||
local $ENV{PTDEBUG} = "";
|
||||
|
||||
#
|
||||
# --tempdir
|
||||
# --save-data
|
||||
#
|
||||
my $dir = tempdir( CLEANUP => 1 );
|
||||
|
||||
`$trunk/bin/$tool --sleep 1 --tempdir $dir`;
|
||||
`$trunk/bin/$tool --sleep 1 --save-data $dir`;
|
||||
|
||||
ok(
|
||||
-e $dir,
|
||||
"Using --tempdir doesn't mistakenly delete the target dir"
|
||||
"Using --save-data doesn't mistakenly delete the target dir"
|
||||
);
|
||||
|
||||
my @files = glob("$dir/*");
|
||||
|
||||
is(
|
||||
scalar @files,
|
||||
14,
|
||||
13,
|
||||
"And leaves all files in there"
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ undef($dir);
|
||||
# --dump-schemas
|
||||
#
|
||||
|
||||
my $out = `$trunk/bin/$tool --sleep 1 --dump-schemas mysql`;
|
||||
my $out = `$trunk/bin/$tool --sleep 1 --dump-schemas mysql 2>/dev/null`;
|
||||
|
||||
like(
|
||||
$out,
|
||||
|
304
t/pt-mysql-summary/samples/temp001/percona-toolkit-mysql-status
Normal file
304
t/pt-mysql-summary/samples/temp001/percona-toolkit-mysql-status
Normal file
@@ -0,0 +1,304 @@
|
||||
Aborted_clients 0
|
||||
Aborted_connects 0
|
||||
Binlog_cache_disk_use 0
|
||||
Binlog_cache_use 0
|
||||
Bytes_received 340
|
||||
Bytes_sent 10867
|
||||
Com_admin_commands 0
|
||||
Com_assign_to_keycache 0
|
||||
Com_alter_db 0
|
||||
Com_alter_db_upgrade 0
|
||||
Com_alter_event 0
|
||||
Com_alter_function 0
|
||||
Com_alter_procedure 0
|
||||
Com_alter_server 0
|
||||
Com_alter_table 0
|
||||
Com_alter_tablespace 0
|
||||
Com_analyze 0
|
||||
Com_backup_table 0
|
||||
Com_begin 0
|
||||
Com_binlog 0
|
||||
Com_call_procedure 0
|
||||
Com_change_db 0
|
||||
Com_change_master 0
|
||||
Com_check 0
|
||||
Com_checksum 0
|
||||
Com_commit 0
|
||||
Com_create_db 0
|
||||
Com_create_event 0
|
||||
Com_create_function 0
|
||||
Com_create_index 0
|
||||
Com_create_procedure 0
|
||||
Com_create_server 0
|
||||
Com_create_table 0
|
||||
Com_create_trigger 0
|
||||
Com_create_udf 0
|
||||
Com_create_user 0
|
||||
Com_create_view 0
|
||||
Com_dealloc_sql 0
|
||||
Com_delete 0
|
||||
Com_delete_multi 0
|
||||
Com_do 0
|
||||
Com_drop_db 0
|
||||
Com_drop_event 0
|
||||
Com_drop_function 0
|
||||
Com_drop_index 0
|
||||
Com_drop_procedure 0
|
||||
Com_drop_server 0
|
||||
Com_drop_table 0
|
||||
Com_drop_trigger 0
|
||||
Com_drop_user 0
|
||||
Com_drop_view 0
|
||||
Com_empty_query 0
|
||||
Com_execute_sql 0
|
||||
Com_flush 0
|
||||
Com_grant 0
|
||||
Com_ha_close 0
|
||||
Com_ha_open 0
|
||||
Com_ha_read 0
|
||||
Com_help 0
|
||||
Com_insert 0
|
||||
Com_insert_select 0
|
||||
Com_install_plugin 0
|
||||
Com_kill 0
|
||||
Com_load 0
|
||||
Com_load_master_data 0
|
||||
Com_load_master_table 0
|
||||
Com_lock_tables 0
|
||||
Com_optimize 0
|
||||
Com_preload_keys 0
|
||||
Com_prepare_sql 0
|
||||
Com_purge 0
|
||||
Com_purge_before_date 0
|
||||
Com_release_savepoint 0
|
||||
Com_rename_table 0
|
||||
Com_rename_user 0
|
||||
Com_repair 0
|
||||
Com_replace 0
|
||||
Com_replace_select 0
|
||||
Com_reset 0
|
||||
Com_restore_table 0
|
||||
Com_revoke 0
|
||||
Com_revoke_all 0
|
||||
Com_rollback 0
|
||||
Com_rollback_to_savepoint 0
|
||||
Com_savepoint 0
|
||||
Com_select 4
|
||||
Com_set_option 0
|
||||
Com_show_authors 0
|
||||
Com_show_binlog_events 0
|
||||
Com_show_binlogs 0
|
||||
Com_show_charsets 0
|
||||
Com_show_client_statistics 0
|
||||
Com_show_collations 0
|
||||
Com_show_column_types 0
|
||||
Com_show_contributors 0
|
||||
Com_show_create_db 0
|
||||
Com_show_create_event 0
|
||||
Com_show_create_func 0
|
||||
Com_show_create_proc 0
|
||||
Com_show_create_table 0
|
||||
Com_show_create_trigger 0
|
||||
Com_show_databases 0
|
||||
Com_show_engine_logs 0
|
||||
Com_show_engine_mutex 0
|
||||
Com_show_engine_status 0
|
||||
Com_show_events 0
|
||||
Com_show_errors 0
|
||||
Com_show_fields 0
|
||||
Com_show_function_status 0
|
||||
Com_show_grants 0
|
||||
Com_show_index_statistics 0
|
||||
Com_show_keys 0
|
||||
Com_show_master_status 0
|
||||
Com_show_new_master 0
|
||||
Com_show_open_tables 0
|
||||
Com_show_patches 0
|
||||
Com_show_plugins 0
|
||||
Com_show_privileges 0
|
||||
Com_show_procedure_status 0
|
||||
Com_show_processlist 0
|
||||
Com_show_profile 0
|
||||
Com_show_profiles 0
|
||||
Com_show_slave_hosts 0
|
||||
Com_show_slave_status 0
|
||||
Com_show_slave_status_nolock 0
|
||||
Com_show_status 1
|
||||
Com_show_storage_engines 0
|
||||
Com_show_table_statistics 0
|
||||
Com_show_table_status 0
|
||||
Com_show_tables 0
|
||||
Com_show_thread_statistics 0
|
||||
Com_show_temporary_tables 0
|
||||
Com_show_triggers 0
|
||||
Com_show_user_statistics 0
|
||||
Com_show_variables 1
|
||||
Com_show_warnings 0
|
||||
Com_slave_start 0
|
||||
Com_slave_stop 0
|
||||
Com_stmt_close 0
|
||||
Com_stmt_execute 0
|
||||
Com_stmt_fetch 0
|
||||
Com_stmt_prepare 0
|
||||
Com_stmt_reprepare 0
|
||||
Com_stmt_reset 0
|
||||
Com_stmt_send_long_data 0
|
||||
Com_truncate 0
|
||||
Com_uninstall_plugin 0
|
||||
Com_unlock_tables 0
|
||||
Com_update 0
|
||||
Com_update_multi 0
|
||||
Com_xa_commit 0
|
||||
Com_xa_end 0
|
||||
Com_xa_prepare 0
|
||||
Com_xa_recover 0
|
||||
Com_xa_rollback 0
|
||||
Com_xa_start 0
|
||||
Compression OFF
|
||||
Connections 4
|
||||
Created_tmp_disk_tables 0
|
||||
Created_tmp_files 5
|
||||
Created_tmp_tables 2
|
||||
Delayed_errors 0
|
||||
Delayed_insert_threads 0
|
||||
Delayed_writes 0
|
||||
Flashcache_enabled OFF
|
||||
Flush_commands 1
|
||||
Handler_commit 0
|
||||
Handler_delete 0
|
||||
Handler_discover 0
|
||||
Handler_prepare 0
|
||||
Handler_read_first 3
|
||||
Handler_read_key 0
|
||||
Handler_read_next 0
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 364
|
||||
Handler_rollback 0
|
||||
Handler_savepoint 0
|
||||
Handler_savepoint_rollback 0
|
||||
Handler_update 0
|
||||
Handler_write 348
|
||||
Innodb_buffer_pool_pages_data 150
|
||||
Innodb_buffer_pool_pages_dirty 0
|
||||
Innodb_buffer_pool_pages_flushed 0
|
||||
Innodb_buffer_pool_pages_free 8041
|
||||
Innodb_buffer_pool_pages_misc 0
|
||||
Innodb_buffer_pool_pages_total 8191
|
||||
Innodb_buffer_pool_read_ahead_rnd 0
|
||||
Innodb_buffer_pool_read_ahead 0
|
||||
Innodb_buffer_pool_read_ahead_evicted 0
|
||||
Innodb_buffer_pool_read_requests 488
|
||||
Innodb_buffer_pool_reads 151
|
||||
Innodb_buffer_pool_wait_free 0
|
||||
Innodb_buffer_pool_write_requests 0
|
||||
Innodb_data_fsyncs 3
|
||||
Innodb_data_pending_fsyncs 0
|
||||
Innodb_data_pending_reads 0
|
||||
Innodb_data_pending_writes 0
|
||||
Innodb_data_read 4657152
|
||||
Innodb_data_reads 161
|
||||
Innodb_data_writes 3
|
||||
Innodb_data_written 1536
|
||||
Innodb_dblwr_pages_written 0
|
||||
Innodb_deadlocks 0
|
||||
Innodb_dblwr_writes 0
|
||||
Innodb_dict_tables 8
|
||||
Innodb_have_atomic_builtins OFF
|
||||
Innodb_log_waits 0
|
||||
Innodb_log_write_requests 0
|
||||
Innodb_log_writes 1
|
||||
Innodb_os_log_fsyncs 3
|
||||
Innodb_os_log_pending_fsyncs 0
|
||||
Innodb_os_log_pending_writes 0
|
||||
Innodb_os_log_written 512
|
||||
Innodb_page_size 16384
|
||||
Innodb_pages_created 0
|
||||
Innodb_pages_read 150
|
||||
Innodb_pages_written 0
|
||||
Innodb_row_lock_current_waits 0
|
||||
Innodb_row_lock_time 0
|
||||
Innodb_row_lock_time_avg 0
|
||||
Innodb_row_lock_time_max 0
|
||||
Innodb_row_lock_waits 0
|
||||
Innodb_rows_deleted 0
|
||||
Innodb_rows_inserted 0
|
||||
Innodb_rows_read 0
|
||||
Innodb_rows_updated 0
|
||||
Key_blocks_not_flushed 0
|
||||
Key_blocks_unused 14497
|
||||
Key_blocks_used 0
|
||||
Key_read_requests 0
|
||||
Key_reads 0
|
||||
Key_write_requests 0
|
||||
Key_writes 0
|
||||
Last_query_cost 0.000000
|
||||
Max_used_connections 1
|
||||
Not_flushed_delayed_rows 0
|
||||
Open_files 16
|
||||
Open_streams 0
|
||||
Open_table_definitions 15
|
||||
Open_tables 8
|
||||
Opened_files 57
|
||||
Opened_table_definitions 15
|
||||
Opened_tables 15
|
||||
Prepared_stmt_count 0
|
||||
Qcache_free_blocks 1
|
||||
Qcache_free_memory 16768400
|
||||
Qcache_hits 0
|
||||
Qcache_inserts 0
|
||||
Qcache_lowmem_prunes 0
|
||||
Qcache_not_cached 4
|
||||
Qcache_queries_in_cache 0
|
||||
Qcache_total_blocks 1
|
||||
Queries 8
|
||||
Questions 8
|
||||
Rpl_status NULL
|
||||
Select_full_join 0
|
||||
Select_full_range_join 0
|
||||
Select_range 0
|
||||
Select_range_check 0
|
||||
Select_scan 2
|
||||
Slave_open_temp_tables 0
|
||||
Slave_retried_transactions 0
|
||||
Slave_running OFF
|
||||
Slow_launch_threads 0
|
||||
Slow_queries 0
|
||||
Sort_merge_passes 0
|
||||
Sort_range 0
|
||||
Sort_rows 0
|
||||
Sort_scan 0
|
||||
Ssl_accept_renegotiates 0
|
||||
Ssl_accepts 0
|
||||
Ssl_callback_cache_hits 0
|
||||
Ssl_cipher
|
||||
Ssl_cipher_list
|
||||
Ssl_client_connects 0
|
||||
Ssl_connect_renegotiates 0
|
||||
Ssl_ctx_verify_depth 0
|
||||
Ssl_ctx_verify_mode 0
|
||||
Ssl_default_timeout 0
|
||||
Ssl_finished_accepts 0
|
||||
Ssl_finished_connects 0
|
||||
Ssl_session_cache_hits 0
|
||||
Ssl_session_cache_misses 0
|
||||
Ssl_session_cache_mode NONE
|
||||
Ssl_session_cache_overflows 0
|
||||
Ssl_session_cache_size 0
|
||||
Ssl_session_cache_timeouts 0
|
||||
Ssl_sessions_reused 0
|
||||
Ssl_used_session_cache_entries 0
|
||||
Ssl_verify_depth 0
|
||||
Ssl_verify_mode 0
|
||||
Ssl_version
|
||||
Table_locks_immediate 18
|
||||
Table_locks_waited 0
|
||||
Tc_log_max_pages_used 0
|
||||
Tc_log_page_size 0
|
||||
Tc_log_page_waits 0
|
||||
Threads_cached 0
|
||||
Threads_connected 1
|
||||
Threads_created 1
|
||||
Threads_running 1
|
||||
Uptime 9
|
||||
Uptime_since_flush_status 9
|
@@ -0,0 +1,355 @@
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
autocommit ON
|
||||
automatic_sp_privileges ON
|
||||
back_log 50
|
||||
basedir /usr/
|
||||
big_tables OFF
|
||||
binlog_cache_size 32768
|
||||
binlog_direct_non_transactional_updates OFF
|
||||
binlog_format STATEMENT
|
||||
bulk_insert_buffer_size 8388608
|
||||
character_set_client latin1
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
character_set_results latin1
|
||||
character_set_server latin1
|
||||
character_set_system utf8
|
||||
character_sets_dir /usr/share/mysql/charsets/
|
||||
collation_connection latin1_swedish_ci
|
||||
collation_database latin1_swedish_ci
|
||||
collation_server latin1_swedish_ci
|
||||
completion_type 0
|
||||
concurrent_insert 1
|
||||
connect_timeout 10
|
||||
datadir /var/lib/mysql/
|
||||
date_format %Y-%m-%d
|
||||
datetime_format %Y-%m-%d %H:%i:%s
|
||||
default_week_format 0
|
||||
delay_key_write ON
|
||||
delayed_insert_limit 100
|
||||
delayed_insert_timeout 300
|
||||
delayed_queue_size 1000
|
||||
div_precision_increment 4
|
||||
enable_query_response_time_stats OFF
|
||||
engine_condition_pushdown ON
|
||||
error_count 0
|
||||
event_scheduler OFF
|
||||
expand_fast_index_creation OFF
|
||||
expire_logs_days 10
|
||||
fast_index_creation ON
|
||||
flush OFF
|
||||
flush_time 0
|
||||
foreign_key_checks ON
|
||||
ft_boolean_syntax + -><()~*:""&|
|
||||
ft_max_word_len 84
|
||||
ft_min_word_len 4
|
||||
ft_query_expansion_limit 20
|
||||
ft_stopword_file (built-in)
|
||||
general_log OFF
|
||||
general_log_file /var/lib/mysql/hugmeir.log
|
||||
group_concat_max_len 1024
|
||||
have_community_features YES
|
||||
have_compress YES
|
||||
have_crypt YES
|
||||
have_csv YES
|
||||
have_dynamic_loading YES
|
||||
have_geometry YES
|
||||
have_innodb YES
|
||||
have_ndbcluster NO
|
||||
have_openssl DISABLED
|
||||
have_partitioning YES
|
||||
have_query_cache YES
|
||||
have_response_time_distribution YES
|
||||
have_rtree_keys YES
|
||||
have_ssl DISABLED
|
||||
have_symlink YES
|
||||
hostname hugmeir
|
||||
identity 0
|
||||
ignore_builtin_innodb OFF
|
||||
init_connect
|
||||
init_file
|
||||
init_slave
|
||||
innodb_adaptive_checkpoint estimate
|
||||
innodb_adaptive_flushing OFF
|
||||
innodb_adaptive_hash_index ON
|
||||
innodb_additional_mem_pool_size 8388608
|
||||
innodb_auto_lru_dump 0
|
||||
innodb_autoextend_increment 8
|
||||
innodb_autoinc_lock_mode 1
|
||||
innodb_blocking_lru_restore OFF
|
||||
innodb_buffer_pool_shm_checksum ON
|
||||
innodb_buffer_pool_shm_key 0
|
||||
innodb_buffer_pool_size 134217728
|
||||
innodb_change_buffering inserts
|
||||
innodb_checkpoint_age_target 0
|
||||
innodb_checksums ON
|
||||
innodb_commit_concurrency 0
|
||||
innodb_concurrency_tickets 500
|
||||
innodb_data_file_path ibdata1:10M:autoextend
|
||||
innodb_data_home_dir
|
||||
innodb_dict_size_limit 0
|
||||
innodb_doublewrite ON
|
||||
innodb_doublewrite_file
|
||||
innodb_enable_unsafe_group_commit 0
|
||||
innodb_expand_import 0
|
||||
innodb_extra_rsegments 0
|
||||
innodb_extra_undoslots OFF
|
||||
innodb_fake_changes OFF
|
||||
innodb_fast_checksum OFF
|
||||
innodb_fast_recovery OFF
|
||||
innodb_fast_shutdown 1
|
||||
innodb_file_format Antelope
|
||||
innodb_file_format_check Barracuda
|
||||
innodb_file_per_table OFF
|
||||
innodb_flush_log_at_trx_commit 1
|
||||
innodb_flush_log_at_trx_commit_session 3
|
||||
innodb_flush_method
|
||||
innodb_flush_neighbor_pages 1
|
||||
innodb_force_recovery 0
|
||||
innodb_ibuf_accel_rate 100
|
||||
innodb_ibuf_active_contract 1
|
||||
innodb_ibuf_max_size 67092480
|
||||
innodb_io_capacity 200
|
||||
innodb_kill_idle_transaction 0
|
||||
innodb_lazy_drop_table 0
|
||||
innodb_lock_wait_timeout 50
|
||||
innodb_locks_unsafe_for_binlog OFF
|
||||
innodb_log_block_size 512
|
||||
innodb_log_buffer_size 8388608
|
||||
innodb_log_file_size 1572864000
|
||||
innodb_log_files_in_group 2
|
||||
innodb_log_group_home_dir ./
|
||||
innodb_max_dirty_pages_pct 75
|
||||
innodb_max_purge_lag 0
|
||||
innodb_mirrored_log_groups 1
|
||||
innodb_old_blocks_pct 37
|
||||
innodb_old_blocks_time 0
|
||||
innodb_open_files 300
|
||||
innodb_overwrite_relay_log_info OFF
|
||||
innodb_page_size 16384
|
||||
innodb_pass_corrupt_table 0
|
||||
innodb_random_read_ahead OFF
|
||||
innodb_read_ahead linear
|
||||
innodb_read_ahead_threshold 56
|
||||
innodb_read_io_threads 4
|
||||
innodb_recovery_stats OFF
|
||||
innodb_replication_delay 0
|
||||
innodb_rollback_on_timeout OFF
|
||||
innodb_show_locks_held 10
|
||||
innodb_show_verbose_locks 0
|
||||
innodb_spin_wait_delay 6
|
||||
innodb_stats_auto_update 1
|
||||
innodb_stats_method nulls_equal
|
||||
innodb_stats_on_metadata ON
|
||||
innodb_stats_sample_pages 8
|
||||
innodb_stats_update_need_lock 1
|
||||
innodb_strict_mode OFF
|
||||
innodb_support_xa ON
|
||||
innodb_sync_spin_loops 30
|
||||
innodb_table_locks ON
|
||||
innodb_thread_concurrency 0
|
||||
innodb_thread_concurrency_timer_based OFF
|
||||
innodb_thread_sleep_delay 10000
|
||||
innodb_use_purge_thread 1
|
||||
innodb_use_sys_malloc ON
|
||||
innodb_use_sys_stats_table OFF
|
||||
innodb_version 1.0.17-13.2
|
||||
innodb_write_io_threads 4
|
||||
insert_id 0
|
||||
interactive_timeout 28800
|
||||
join_buffer_size 131072
|
||||
keep_files_on_create OFF
|
||||
key_buffer_size 16777216
|
||||
key_cache_age_threshold 300
|
||||
key_cache_block_size 1024
|
||||
key_cache_division_limit 100
|
||||
language /usr/share/mysql/english/
|
||||
large_files_support ON
|
||||
large_page_size 0
|
||||
large_pages OFF
|
||||
last_insert_id 0
|
||||
lc_time_names en_US
|
||||
license GPL
|
||||
local_infile ON
|
||||
locked_in_memory OFF
|
||||
log OFF
|
||||
log_bin OFF
|
||||
log_bin_trust_function_creators OFF
|
||||
log_bin_trust_routine_creators OFF
|
||||
log_error /var/log/mysql/error.log
|
||||
log_output FILE
|
||||
log_queries_not_using_indexes OFF
|
||||
log_slave_updates OFF
|
||||
log_slow_admin_statements OFF
|
||||
log_slow_filter
|
||||
log_slow_queries OFF
|
||||
log_slow_rate_limit 1
|
||||
log_slow_slave_statements OFF
|
||||
log_slow_sp_statements ON
|
||||
log_slow_timestamp_every OFF
|
||||
log_slow_verbosity microtime
|
||||
log_warnings 1
|
||||
long_query_time 10.000000
|
||||
low_priority_updates OFF
|
||||
lower_case_file_system OFF
|
||||
lower_case_table_names 0
|
||||
max_allowed_packet 16777216
|
||||
max_binlog_cache_size 4294963200
|
||||
max_binlog_size 104857600
|
||||
max_connect_errors 10
|
||||
max_connections 151
|
||||
max_delayed_threads 20
|
||||
max_error_count 64
|
||||
max_heap_table_size 16777216
|
||||
max_insert_delayed_threads 20
|
||||
max_join_size 4294967295
|
||||
max_length_for_sort_data 1024
|
||||
max_long_data_size 16777216
|
||||
max_prepared_stmt_count 16382
|
||||
max_relay_log_size 0
|
||||
max_seeks_for_key 4294967295
|
||||
max_sort_length 1024
|
||||
max_sp_recursion_depth 0
|
||||
max_tmp_tables 32
|
||||
max_user_connections 0
|
||||
max_write_lock_count 4294967295
|
||||
min_examined_row_limit 0
|
||||
multi_range_count 256
|
||||
myisam_data_pointer_size 6
|
||||
myisam_max_sort_file_size 2146435072
|
||||
myisam_mmap_size 4294967295
|
||||
myisam_recover_options BACKUP
|
||||
myisam_repair_threads 1
|
||||
myisam_sort_buffer_size 8388608
|
||||
myisam_stats_method nulls_unequal
|
||||
myisam_use_mmap OFF
|
||||
net_buffer_length 16384
|
||||
net_read_timeout 30
|
||||
net_retry_count 10
|
||||
net_write_timeout 60
|
||||
new OFF
|
||||
old OFF
|
||||
old_alter_table OFF
|
||||
old_passwords OFF
|
||||
open_files_limit 1024
|
||||
optimizer_fix ON
|
||||
optimizer_prune_level 1
|
||||
optimizer_search_depth 62
|
||||
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
|
||||
pid_file /var/lib/mysql/hugmeir.pid
|
||||
plugin_dir /usr/lib/mysql/plugin
|
||||
port 3306
|
||||
preload_buffer_size 32768
|
||||
profiling OFF
|
||||
profiling_history_size 15
|
||||
profiling_server OFF
|
||||
profiling_use_getrusage OFF
|
||||
protocol_version 10
|
||||
pseudo_thread_id 0
|
||||
query_alloc_block_size 8192
|
||||
query_cache_limit 1048576
|
||||
query_cache_min_res_unit 4096
|
||||
query_cache_size 16777216
|
||||
query_cache_strip_comments OFF
|
||||
query_cache_type ON
|
||||
query_cache_wlock_invalidate OFF
|
||||
query_prealloc_size 8192
|
||||
query_response_time_range_base 10
|
||||
rand_seed1
|
||||
rand_seed2
|
||||
range_alloc_block_size 4096
|
||||
read_buffer_size 131072
|
||||
read_only OFF
|
||||
read_rnd_buffer_size 262144
|
||||
relay_log
|
||||
relay_log_index
|
||||
relay_log_info_file relay-log.info
|
||||
relay_log_purge ON
|
||||
relay_log_space_limit 0
|
||||
report_host
|
||||
report_password
|
||||
report_port 3306
|
||||
report_user
|
||||
rpl_recovery_rank 0
|
||||
secure_auth OFF
|
||||
secure_file_priv
|
||||
server_id 0
|
||||
skip_external_locking ON
|
||||
skip_name_resolve OFF
|
||||
skip_networking OFF
|
||||
skip_show_database OFF
|
||||
slave_compressed_protocol OFF
|
||||
slave_exec_mode STRICT
|
||||
slave_load_tmpdir /tmp
|
||||
slave_net_timeout 3600
|
||||
slave_skip_errors OFF
|
||||
slave_transaction_retries 10
|
||||
slow_launch_time 2
|
||||
slow_query_log OFF
|
||||
slow_query_log_file /var/lib/mysql/hugmeir-slow.log
|
||||
slow_query_log_microseconds_timestamp OFF
|
||||
socket /var/run/mysqld/mysqld.sock
|
||||
sort_buffer_size 2097144
|
||||
sql_auto_is_null ON
|
||||
sql_big_selects ON
|
||||
sql_big_tables OFF
|
||||
sql_buffer_result OFF
|
||||
sql_log_bin ON
|
||||
sql_log_off OFF
|
||||
sql_log_update ON
|
||||
sql_low_priority_updates OFF
|
||||
sql_max_join_size 4294967295
|
||||
sql_mode
|
||||
sql_notes ON
|
||||
sql_quote_show_create ON
|
||||
sql_safe_updates OFF
|
||||
sql_select_limit 4294967295
|
||||
sql_slave_skip_counter
|
||||
sql_warnings OFF
|
||||
ssl_ca
|
||||
ssl_capath
|
||||
ssl_cert
|
||||
ssl_cipher
|
||||
ssl_key
|
||||
storage_engine MyISAM
|
||||
suppress_log_warning_1592 OFF
|
||||
sync_binlog 0
|
||||
sync_frm ON
|
||||
system_time_zone PST
|
||||
table_definition_cache 256
|
||||
table_lock_wait_timeout 50
|
||||
table_open_cache 64
|
||||
table_type MyISAM
|
||||
thread_cache_size 8
|
||||
thread_handling one-thread-per-connection
|
||||
thread_stack 196608
|
||||
thread_statistics OFF
|
||||
time_format %H:%i:%s
|
||||
time_zone SYSTEM
|
||||
timed_mutexes OFF
|
||||
timestamp 1330708900
|
||||
tmp_table_size 16777216
|
||||
tmpdir /tmp
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
tx_isolation REPEATABLE-READ
|
||||
unique_checks ON
|
||||
updatable_views_with_limit YES
|
||||
use_global_log_slow_control none
|
||||
use_global_long_query_time OFF
|
||||
userstat_running OFF
|
||||
version 5.1.61rel13.2
|
||||
version_comment Percona Server with XtraDB (GPL), Release rel13.2, Revision 430
|
||||
version_compile_machine i686
|
||||
version_compile_os pc-linux-gnu
|
||||
wait_timeout 28800
|
||||
warning_count 0
|
||||
pt-summary-internal-current_time 2012-03-02 09:21
|
||||
pt-summary-internal-Config_File /etc/mysql/my.cnf
|
||||
pt-summary-internal-now 2012-03-02 09:21:41
|
||||
pt-summary-internal-user hugmeir@localhost
|
||||
pt-summary-internal-FNV_64 Unknown
|
||||
pt-summary-internal-trigger_count 0
|
||||
pt-summary-internal-symbols Yes
|
Reference in New Issue
Block a user