From ee4254ec6a69ac0a495086853bf467ee617df7c3 Mon Sep 17 00:00:00 2001 From: Nils K Date: Thu, 6 Oct 2022 21:19:00 +0200 Subject: [PATCH] munin ansible --- munin/plugins/README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/munin/plugins/README.md b/munin/plugins/README.md index e93d1f6..dc4d1a0 100644 --- a/munin/plugins/README.md +++ b/munin/plugins/README.md @@ -21,4 +21,30 @@ Dir: `/usr/share/munin/plugins/` * [x] mysql_threads > * [x] Included in the Ubuntu package -> * [ ] Must be installed manually \ No newline at end of file +> * [ ] Must be installed manually + +Used in Ansible Playbook: + +```yml +# MySQL +- name: Munin node - Check MySQL server + ansible.builtin.stat: + path: /usr/sbin/mysqld + register: mysqld +- name: Munin node - Download more MySQL plugins + ansible.builtin.get_url: + url: "{{ item.url }}" + dest: "/usr/local/share/munin/plugins/{{ item.file }}" + mode: '0755' + owner: root + group: root + loop: + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_connections, file: mysql_connections } + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_keybuffer, file: mysql_keybuffer } + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_keys, file: mysql_keys } + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_qcache_hits, file: mysql_qcache_hits } + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_qcache_mem, file: mysql_qcache_mem } + - { url: https://raw.githubusercontent.com/Cyclenerd/toolbox/master/munin/plugins/mysql_size_, file: mysql_size_ } + when: + mysqld.stat.exists +``` \ No newline at end of file