mysql: install save_mysql_processlist script
This commit is contained in:
parent
1d8b7c3bea
commit
86d59cbb5f
3 changed files with 35 additions and 0 deletions
|
@ -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
Normal file
25
mysql/files/save_mysql_processlist.sh
Normal file
|
@ -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
|
|
@ -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…
Add table
Reference in a new issue