ansible-roles/mysql/files/mysql_binlog_days
Ludovic Poujol a65230b5e0
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2625|7|2618|5|:-1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/360//ansiblelint">Evolix » ansible-roles » unstable #360</a>
gitea/ansible-roles/pipeline/head This commit looks good
mysql: new munin graph to follow binlog_days over time
2023-09-26 17:35:14 +02:00

45 lines
973 B
Bash

#!/bin/sh
output_config() {
echo "graph_title MySQL - Value of expire_logs_days variable"
echo "graph_category mysql"
echo "binlogdays.label Number of days of storage of binary logs"
echo "binlogdays.draw AREA"
echo 'graph_args -l 0'
echo 'graph_scale no'
}
output_values() {
printf "binlogdays.value %d\n" $(binlog_days)
}
binlog_days() {
mysql --skip-column-names --silent --execute "show variables like 'expire_logs_days';" | awk '{print $2}'
}
output_usage() {
printf >&2 "%s - munin plugin to graph value of MySQL expire_logs_days system variable\n" ${0##*/}
printf >&2 "Usage: %s [config]\n" ${0##*/}
}
case $# in
0)
output_values
;;
1)
case $1 in
config)
output_config
;;
*)
output_usage
exit 1
;;
esac
;;
*)
output_usage
exit 1
;;
esac