From e4e0966d9d6798289f0511d3153a16a112831044 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Wed, 29 Apr 2020 16:33:16 +0200
Subject: [PATCH] Reduce frequency of health checks

---
 templates/httpcheck.conf | 8 ++++++++
 templates/phpfpm.conf    | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/templates/httpcheck.conf b/templates/httpcheck.conf
index d53f3fb..87bc1ac 100644
--- a/templates/httpcheck.conf
+++ b/templates/httpcheck.conf
@@ -109,6 +109,9 @@ redirect: no
 {% if item.redirect|default(false) %}
     redirect: yes
 {% endif %}
+{% if item.interval is defined %}
+    update_every: {{ item.interval }}
+{% endif %}
 {% if item.timeout is defined %}
     timeout: {{ item.timeout }}
 {% endif %}
@@ -128,6 +131,9 @@ redirect: no
 {% if site.uptime.pollerParams|default(false) and site.uptime.pollerParams.body|default(false) %}
     regex: {{ site.uptime.pollerParams.body|regex_escape() }}
 {% endif %}
+{% if site.uptime.interval is defined %}
+    update_every: {{ site.uptime.interval }}
+{% endif %}
 {% if site.uptime.timeout|default(false) %}
     timeout: {{ site.uptime.timeout }}
 {% endif %}
@@ -147,6 +153,7 @@ redirect: no
 {% if site.uptime.pollerParams|default(false) and site.uptime.pollerParams.body|default(false) %}
     regex: {{ site.uptime.pollerParams.body|regex_escape() }}
 {% endif %}
+    update_every: 5
 {% if site.uptime.timeout|default(false) %}
     timeout: {{ site.uptime.timeout }}
 {% endif %}
@@ -162,5 +169,6 @@ redirect: no
     header:
       Authorization: Basic {{ (site.ocs.username + ':' + site.ocs.password) | b64encode }}
     regex: {{ '"status":"ok"'|regex_escape() }}
+    update_every: 1{{ loop.index }}
 {% endif %}
 {% endfor %}
diff --git a/templates/phpfpm.conf b/templates/phpfpm.conf
index f30bd8e..763e711 100644
--- a/templates/phpfpm.conf
+++ b/templates/phpfpm.conf
@@ -1,3 +1,5 @@
+update_every: 5
+
 local:
   name : "local"
   url  : "http://localhost/fpm-status.php?full&json"
-- 
GitLab