From 3ca97db32463cbc2b83c7d271f733e95e7cdcc77 Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 23 Nov 2021 21:29:01 +0100 Subject: [PATCH] =?UTF-8?q?Verschiebe=20monit-=C3=9Cberwachung=20in=20Mari?= =?UTF-8?q?aDB-Rolle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/monit.j2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 templates/monit.j2 diff --git a/templates/monit.j2 b/templates/monit.j2 new file mode 100644 index 0000000..7f40957 --- /dev/null +++ b/templates/monit.j2 @@ -0,0 +1,14 @@ +check process mysqld with pidfile /var/run/mysqld/mysqld.pid + group database + start program = "/usr/sbin/service mysql start" + stop program = "/usr/sbin/service mysql stop" +{% if inventory_hostname == "orwell" or inventory_hostname == "wwwusers-ng.sao" %} + if failed host 127.0.0.1 +{% else %} + if failed host {{ ansible_default_ipv4.address }} +{% endif %} + port 3306 protocol mysql + username "{{ monit_sql_user }}" password "{{ monit_sql_password }}" + with timeout 15 seconds for 3 times within 4 cycles then restart + if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart + if 5 restarts with 5 cycles then timeout