diff --git a/roles/nagios_server/files/nagios/services/copr_external.cfg b/roles/nagios_server/files/nagios/services/copr_external.cfg index a9efbfd499..29d7107dd4 100644 --- a/roles/nagios_server/files/nagios/services/copr_external.cfg +++ b/roles/nagios_server/files/nagios/services/copr_external.cfg @@ -1,6 +1,6 @@ define service { hostgroup_name copr_back_aws, copr_back_dev_aws - service_description Copr ping package builds (that chould always succeed) + service_description The copr-ping package builds check_command check_by_nrpe!check_copr_ping use defaulttemplate } diff --git a/roles/nagios_server/templates/nagios/hostgroups/all-external.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/all-external.cfg.j2 index d369ddd598..a1774921b0 100644 --- a/roles/nagios_server/templates/nagios/hostgroups/all-external.cfg.j2 +++ b/roles/nagios_server/templates/nagios/hostgroups/all-external.cfg.j2 @@ -25,3 +25,14 @@ define hostgroup { members {% for host in groups["unbound"]|sort %}{{ host }}{% if not loop.last %}, {% endif %} {% endfor %} } + +{% for key, value in groups.items()|sort %} +{% if groups[key] != [] and key.startswith('copr') %} +define hostgroup{ + hostgroup_name {{ key }} + alias {{ key }} + members {% for host in groups[key]|sort %}{% if hostvars[host].nagios_Can_Connect == true %}{{host}}, {% endif %}{% endfor %} + +} +{% endif %} +{% endfor %}