diff --git a/templates/nrpe.cfg.j2 b/templates/nrpe.cfg.j2 index 2b2fd16933e22e1c939d13a28861c3ad8a3eebd1..5c12efa54ebe7823175a7bc699e22ecce924c934 100644 --- a/templates/nrpe.cfg.j2 +++ b/templates/nrpe.cfg.j2 @@ -24,7 +24,7 @@ command[check_raid_{{ device }}]=/usr/lib/nagios/custom-plugins/check_mdstat.sh command[check_load]=/usr/lib/nagios/plugins/check_load -r -w .85,.80,.75 -c .99,.95,.90 command[check_mem]=/usr/lib/nagios/custom-plugins/check_mem.pl -f -C -w 20 -c 5 {% if inventory_hostname in groups.docker | default([]) %} -command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w {{ ((group_names | length - 7) * 20 + 370) | int | abs }} -c {{ ((group_names | length - 7) * 20 + 410) | int | abs }} +command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w {{ ((group_names | length - 6) * 20 + 370) | int | abs }} -c {{ ((group_names | length - 6) * 20 + 410) | int | abs }} {% else %} command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 290 -c 350 {% endif %} @@ -105,11 +105,12 @@ command[check_docker_cloud]=/usr/lib/nagios/custom-plugins/check_docker.sh --fil {% endif %} {% endif %} {% if inventory_hostname in groups.docker_odoo | default([]) %} -{% if odoo_prod is defined %} -command[check_docker_odoo]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^odoo($|_.*)' --cpu 10:15 --memory 35:45 +{% for name, values in odoo_instances.items() %} +{% if values.is_prod is defined and values.is_prod %} +command[check_docker_odoo]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^{{ name }}($|_.*)' --cpu 10:15 --memory 35:45 +{% else %} +command[check_docker_odoo]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^{{ name }}($|_.*)' --cpu 10:15 --memory 20:25 {% endif %} -{% for instance in odoo_nonprod_instances | default([]) %} -command[check_docker_{{ instance.name }}]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^{{ instance.dir }}.*' --cpu 10:15 --memory 20:25 {% endfor %} {% if restrict_internet_access and whitelisted_urls is defined %} command[check_docker_whitelists]=/usr/lib/nagios/custom-plugins/check_docker.sh --filter '^whitelists.*' --cpu 10:10 --memory 5:7