nagios: external: define copr_* hostgroups

This commit is contained in:
Pavel Raiskup 2021-08-09 15:25:08 +02:00
parent 8aa8247784
commit ff215ea2b9
2 changed files with 12 additions and 1 deletions

View file

@ -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 %}