Add Monit check address

This commit is contained in:
phil 2023-02-15 22:54:45 +01:00
parent 6d93973878
commit 73bf0925bc
2 changed files with 3 additions and 1 deletions

View file

@ -16,10 +16,12 @@ Folgende Variablen können über die jeweilige `host_vars` im Dictionary `maria
|--|--|--| |--|--|--|
| local_backupdir | string | Lokales Verzeichnis der sql-Backups | | local_backupdir | string | Lokales Verzeichnis der sql-Backups |
| bind_address | string | Listen-Adresse des Mariadb-Servers, wird bisher nicht konfiguriert | | bind_address | string | Listen-Adresse des Mariadb-Servers, wird bisher nicht konfiguriert |
| monit_check_address | string | Adresse für den Monit-Verbindungscheck |
Beispiel: Beispiel:
```YAML ```YAML
mariadb: mariadb:
local_backupdir: /var/lib/backups/mariadb local_backupdir: /var/lib/backups/mariadb
bind_address: "10.0.0.2" bind_address: "10.0.0.2"
monit_check_address: "127.0.0.1"
``` ```

View file

@ -2,7 +2,7 @@ check process mariadb with pidfile /run/mysqld/mysqld.pid
group database group database
start program = "/usr/sbin/service mysql start" start program = "/usr/sbin/service mysql start"
stop program = "/usr/sbin/service mysql stop" stop program = "/usr/sbin/service mysql stop"
if failed host {{ mariadb.bind_address|default( ansible_default_ipv4.address ) }} if failed host {{ mariadb.monit_check_address | default(ansible_default_ipv4.address) }}
port 3306 protocol mysql port 3306 protocol mysql
username "{{ monit_sql_user }}" password "{{ monit_sql_password }}" username "{{ monit_sql_user }}" password "{{ monit_sql_password }}"
with timeout 15 seconds for 3 times within 4 cycles then restart with timeout 15 seconds for 3 times within 4 cycles then restart