% for prettyname, details in sorted(hosts.items()):

${prettyname}

${details['host_state']}
    % for service_name, service_details in sorted(details['services'].items()):
  • ${service_name} ${service_details['state']}
  • % endfor
% endfor