define hostgroup {
        hostgroup_name  nomail
        alias           Detect For 0 Mail In Queue
        members        {% for host in groups['all']|sort %}{% if hostvars[host].nagios_Can_Connect == true and hostvars[host].nagios_Check_Services['nrpe'] == true and hostvars[host].nagios_Check_Services['mail'] == true%}{{host}}, {% endif %}{% endfor %}

}
