Browse Source

Added ee import-slow-log command

old-stable
gau1991 10 years ago
parent
commit
6f3e7d067a
  1. 2
      bin/easyengine
  2. 5
      src/lib/ee_lib_import_slow_log.sh

2
bin/easyengine

@ -738,6 +738,8 @@ elif [ "$EE_FIRST" = "secure" ]; then
elif [ "$EE_FIRST" = "clean" ]; then elif [ "$EE_FIRST" = "clean" ]; then
ee_mod_clean ${@:2} ee_mod_clean ${@:2}
elif [ "$EE_FIRST" = "import-slow-log"];then
ee_lib_import_slow_log
# EasyEngine update # EasyEngine update
elif [ "$EE_FIRST" = "update" ]; then elif [ "$EE_FIRST" = "update" ]; then

5
src/lib/ee_lib_import_slow_log.sh

@ -3,6 +3,8 @@
function ee_lib_import_slow_log() function ee_lib_import_slow_log()
{ {
if [ -d /var/www/22222/htdocs/db/anemometer ]; then
ee_lib_echo "Importing MySQL slow log, please wait..."
dpkg --compare-versions $(pt-query-digest --version | awk '{print $2 }') ge 2.2 dpkg --compare-versions $(pt-query-digest --version | awk '{print $2 }') ge 2.2
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
ee_anemometer_history=history ee_anemometer_history=history
@ -14,4 +16,7 @@ function ee_lib_import_slow_log()
--review D=slow_query_log,t=global_query_review \ --review D=slow_query_log,t=global_query_review \
--${ee_anemometer_history} D=slow_query_log,t=global_query_review_history \ --${ee_anemometer_history} D=slow_query_log,t=global_query_review_history \
--no-report --limit=0% --filter=" \$event->{Bytes} = length(\$event->{arg}) and \$event->{hostname}=\"$EE_MYSQL_GRANT_HOST\"" /var/log/mysql/mysql-slow.log --no-report --limit=0% --filter=" \$event->{Bytes} = length(\$event->{arg}) and \$event->{hostname}=\"$EE_MYSQL_GRANT_HOST\"" /var/log/mysql/mysql-slow.log
else
ee_lib_echo_fail "Anememoter is not installed"
fi
} }

Loading…
Cancel
Save