From d67bc370ac6f9abea3913ab53dfde2add889a859 Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 21 Nov 2021 13:59:05 -0600 Subject: [PATCH] Split nagios-checkhttp into nagios-checkhttp{,s} --- playbooks/tasks/web/nagios-ansible.cfg.j2 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/playbooks/tasks/web/nagios-ansible.cfg.j2 b/playbooks/tasks/web/nagios-ansible.cfg.j2 index 3579f6f..35b1446 100644 --- a/playbooks/tasks/web/nagios-ansible.cfg.j2 +++ b/playbooks/tasks/web/nagios-ansible.cfg.j2 @@ -153,22 +153,25 @@ define host { {% for tag in service.value.tags %} {# #} {% if tag.slug == "nagios-checkhttp" %} -{% if 80 in service.value.ports %} +{% for port in service.value.ports %} define service { use ansible-generic-service - service_description HTTP - {{ service.value.name }} - check_command check_http!-H {{ service.value.name }} -f sticky + service_description HTTP - {{ service.value.name }} - {{ port }} + check_command check_http!-H {{ service.value.name }} -p {{ port }} -f sticky host_name {{ host_name }} } +{% endfor %} {% endif %} -{% if 443 in service.value.ports %} +{# #} +{% if tag.slug == "nagios-checkhttps" %} +{% for port in service.value.ports %} define service { use ansible-generic-service - service_description HTTPS - {{ service.value.name }} - check_command check_http!--ssl -H {{ service.value.name }} -f sticky + service_description HTTPS - {{ service.value.name }} - {{ port }} + check_command check_http!--ssl -H {{ service.value.name }} -p {{ port }} -f sticky host_name {{ host_name }} } -{% endif %} +{% endfor %} {% endif %} {# #} {% if tag.slug == "nagios-checktcp" %}