mysql: new munin graph to follow binlog_days over time
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

This commit is contained in:
Ludovic Poujol 2023-09-26 17:35:14 +02:00
parent ee6bd8cec4
commit a65230b5e0
3 changed files with 54 additions and 0 deletions

View file

@ -31,6 +31,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
* fail2ban: add `fail2ban_sshd_port` variable to configure sshd port
* kvm-host: release 23.09.1 for migrate-vm.sh
* metricbeat/logstash: fix Ansible syntax
* mysql: new munin graph to follow binlog_days over time
* nagios-nrpe: add a NRPE check-local command with completion.
* nagios-nrpe: add a proper monitoring plugin for GlusterFS (on servers, not for clients)
* php: add new variable to disable overriding settings of php-fpm default pool (www)

View file

@ -0,0 +1,44 @@
#!/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

View file

@ -66,6 +66,15 @@
- replication
notify: restart munin-node
- name: Install custom plugin for binlog retention tracking
ansible.builtin.copy:
src: mysql_binlog_days
dest: /etc/munin/plugins/mysql_binlog_days
owner: root
group: root
mode: "0755"
notify: restart munin-node
- name: verify Munin configuration for mysql < Debian 11
ansible.builtin.replace:
dest: /etc/munin/plugin-conf.d/munin-node