Browse Source

mysql: install save_mysql_processlist script

pull/119/head
Jérémy Lecour 5 months ago
committed by Jérémy Lecour
parent
commit
86d59cbb5f
  1. 1
      CHANGELOG.md
  2. 25
      mysql/files/save_mysql_processlist.sh
  3. 9
      mysql/tasks/utils.yml

1
CHANGELOG.md

@ -15,6 +15,7 @@ The **patch** part changes incrementally at each release.
* dovecot: Update munin plugin & configure it
* evoacme: variable to disable Debian version check (default: False)
* kvm-host: Add drbd role dependency (toggleable with kvm_install_drbd)
* mysql: install save_mysql_processlist script
* nextcloud: New role to setup a nextcloud instance
* redis: variable to force use of port 6379 in instances mode
* lxc-php: Allow php containers to contact local MySQL with localhost

25
mysql/files/save_mysql_processlist.sh

@ -0,0 +1,25 @@
#!/bin/sh
set -e
processlist() {
mysqladmin --verbose --vertical processlist
}
DIR="/var/log/mysql-processlist"
TS=`date +%Y%m%d%H%M%S`
FILE="${DIR}/${TS}"
if [ ! -d "${DIR}" ]; then
mkdir -p "${DIR}"
chown root:adm "${DIR}"
chmod 750 "${DIR}"
fi
processlist > "${FILE}"
chmod 640 "${FILE}"
chown root:adm "${FILE}"
find "${DIR}" -type f -mtime +1 -delete
exit 0

9
mysql/tasks/utils.yml

@ -178,3 +178,12 @@
tags:
- mysql
- packages
- name: "Install save_mysql_processlist.sh"
copy:
src: save_mysql_processlist.sh
dest: "{{ mysql_scripts_dir or general_scripts_dir | mandatory }}/save_mysql_processlist.sh"
mode: "0755"
force: no
tags:
- mysql
Loading…
Cancel
Save