From 554f84833d6a1399919f1190a17ce393c1e715d7 Mon Sep 17 00:00:00 2001 From: phil Date: Wed, 23 Mar 2022 14:47:38 +0100 Subject: [PATCH] =?UTF-8?q?zammad:=20Monit-=C3=9Cberwachung=20f=C3=BCr=20E?= =?UTF-8?q?S?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/elasticsearch.monit | 5 +++++ tasks/elastic.yml | 6 ++++++ tasks/main.yml | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 files/elasticsearch.monit diff --git a/files/elasticsearch.monit b/files/elasticsearch.monit new file mode 100644 index 0000000..b9835e3 --- /dev/null +++ b/files/elasticsearch.monit @@ -0,0 +1,5 @@ +check process elasticsearch with pidfile /run/elasticsearch/elasticsearch.pid + start program = "/usr/sbin/service elasticsearch start" + stop program = "/usr/sbin/service elasticsearch stop" + if failed host 127.0.0.1 port 9200 for 3 cycles then restart + if 5 restarts within 5 cycles then timeout diff --git a/tasks/elastic.yml b/tasks/elastic.yml index 49acfb7..e52d56b 100644 --- a/tasks/elastic.yml +++ b/tasks/elastic.yml @@ -75,3 +75,9 @@ RAILS_ENV: production become: true become_user: "{{ zammad_user }}" + +- name: "elastic | Richte Monit-Überwachung ein" + copy: + src: elasticsearch.monit + dest: /etc/monit/conf-enabled/elasticsearch + notify: reload monit diff --git a/tasks/main.yml b/tasks/main.yml index 3c24b54..a8a5611 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,6 +34,5 @@ - import_tasks: gateway.yml tags: gateway -- name: Elastic - include_tasks: elastic.yml +- import_tasks: elastic.yml tags: elastic