[% PROCESS _header.tt %]
[% PROCESS _sounds.tt %]

    <table border="0" width="100%" cellspacing="0" cellpadding="0" id="top_pane"[% IF hidetop == 1 %]style="visibility:hidden; display:none;"[% END %]>
      <tr>
        <td align="left" valign="top" width="33%">
          [% PROCESS _infobox.tt %]

          <table border="1" cellpadding="0" cellspacing="0" class='linkBox'>
            <tr>
              <td class='linkBox'>
                [% IF hostgroup == 'all' %]
                <a href='status.cgi?hostgroup=all&amp;style=detail'>View Service Status Detail For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=hostdetail'>View Host Status Detail For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=overview'>View Status Overview For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=summary'>View Status Summary For All Host Groups</a><br>
                [% ELSIF hostgroup != '' %]
                <a href='status.cgi?hostgroup=all&amp;style=grid'>View Status Grid For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=[% hostgroup | uri %]&amp;style=detail'>View Service Status Detail For This Host Group</a><br>
                <a href='status.cgi?hostgroup=[% hostgroup | uri %]&amp;style=hostdetail'>View Host Status Detail For This Host Group</a><br>
                <a href='status.cgi?hostgroup=[% hostgroup | uri %]&amp;style=overview'>View Status Overview For This Host Group</a><br>
                <a href='status.cgi?hostgroup=[% hostgroup | uri %]&amp;style=summary'>View Status Summary For This Host Group</a><br>
                [% ELSIF servicegroup == 'all' %]
                <a href='status.cgi?servicegroup=all&amp;style=detail'>View Service Status Detail For All Service Groups</a><br>
                <a href='status.cgi?servicegroup=all&amp;style=overview'>View Status Overview For All Service Groups</a><br>
                <a href='status.cgi?servicegroup=all&amp;style=summary'>View Status Summary For All Service Groups</a><br>
                [% ELSIF servicegroup != '' %]
                <a href='status.cgi?servicegroup=[% servicegroup | uri %]&amp;style=detail'>View Service Status Detail For This Service Group</a><br>
                <a href='status.cgi?servicegroup=[% servicegroup | uri %]&amp;style=overview'>View Status Overview For This Service Group</a><br>
                <a href='status.cgi?servicegroup=[% servicegroup | uri %]&amp;style=summary'>View Status Summary For This Service Group</a><br>
                <a href='status.cgi?servicegroup=all&amp;style=grid'>View Service Status Grid For All Service Groups</a><br>
                [% ELSE %]
                <a href='status.cgi?hostgroup=all&amp;style=detail'>View Service Status Detail For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=hostdetail'>View Host Status Detail For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=overview'>View Status Overview For All Host Groups</a><br>
                <a href='status.cgi?hostgroup=all&amp;style=summary'>View Status Summary For All Host Groups</a><br>
                [% END %]
              </td>
            </tr>
          </table>
        </td>
        <td align="center" valign="top" width="33%">[% PROCESS _host_status_details_box.tt %]</td>
        <td align="center" valign="top" width="33%">[% PROCESS _service_status_details_box.tt %]</td>
        <td align="right" valign="bottom">
          [% PROCESS _help.tt topic = "status_grid" %]
        </td>
      </tr>
    </table>
    <table border="0" width="100%" cellpadding=0 cellspacing=0>
      <tr>
        <td valign="top" align="left" width="33%">
          [% PROCESS _status_filter.tt %]
        </td>
        <td valign="top" align="center" width="33%">
          <br>
          [% IF hostgroup == 'all' %]
          <div align="center" class='statusTitle'>Service Grid For All Host Groups</div><br>
          [% ELSIF hostgroup != '' %]
          <div align="center" class='statusTitle'>Service Grid For Host Group '[% hostgroup %]'</div><br>
          [% ELSIF servicegroup == 'all' %]
          <div align="center" class='statusTitle'>Service Grid For All Service Groups</div><br>
          [% ELSIF servicegroup != '' %]
          <div align="center" class='statusTitle'>Service Grid For Service Group '[% servicegroup %]'</div><br>
          [% ELSE %]
          <div align="center" class='statusTitle'>Service Grid</div><br>
          [% END %]
        </td>
        <td valign="bottom" align="right" width="33%">
          [% PROCESS _add_bookmark.tt %]
          [% PROCESS _show_link.tt %]
        </td>
      </tr>
    </table>

    <div align="center">[% PROCESS _pager.tt %]</div>

    <div align="center">

      [% FOR g IN data %]
      [% IF substyle == 'host' %]
      <div class='status'><a href='status.cgi?hostgroup=[% g.name | uri %]&amp;style=detail'>[% g.alias %]</a> (<a href='extinfo.cgi?type=5&amp;hostgroup=[% g.name | uri %]'>[% g.name %]</a>)</div>
      [% ELSIF substyle == 'service' %]
      <div class='status'><a href='status.cgi?servicegroup=[% g.name | uri %]&amp;style=detail'>[% g.alias %]</a> (<a href='extinfo.cgi?type=8&amp;servicegroup=[% g.name | uri %]'>[% g.name %]</a>)</div>
      [% END %]
      <table border="1" class='status statusgroups' align="center">
        <tr>
          <th class='status'>Host</th>
          <th class='status'>Services</th>
          <th class='status'>Actions</th>
        </tr>
        [% FOR hostname IN g.hosts.keys.sort %]
        [% SET h = g.hosts.$hostname %]
        [% SET hostclass = 'statusEven' IF loop.odd  %]
        [% SET hostclass = 'statusOdd'  IF loop.even %]
        [% IF h.state == 1 %]
          [% hostclass = 'statusHOSTDOWN' %]
        [% ELSIF h.state == 2 %]
          [% hostclass = 'statusHOSTUNREACHABLE' %]
        [% END %]
        <tr class='[% hostclass %][% IF loop.first %] firstrow[% END %]'>
          <td class='[% hostclass %]'>
            <table border="0" width='100%' cellpadding="0" cellspacing="0">
              <tr>
                <td align="left">
                  <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td align="left" valign="middle" class='[% hostclass %]'><a href='extinfo.cgi?type=1&amp;host=[% h.name | uri %]'>[% h.display_name %]</a></td>
                    </tr>
                  </table>
                </td>
                <td align="right" valign="middle" nowrap>
                  <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td>
                        [% IF h.icon_image_expanded %]
                        <a href='extinfo.cgi?type=1&amp;host=[% h.name | uri %]'><img src='[% logo_path_prefix %][% h.icon_image_expanded %]' border="0" width="20" height="20" alt='[% h.icon_image_alt %]' title='[% h.icon_image_alt %]'></a>
                        [% END %]
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td class='[% hostclass %]'>
            [% FOR servicename IN h.services.keys.sort %]
            [% SET s = h.services.$servicename %]
            [% IF s.has_been_checked == 0 %]
              [% SET s_status = 'statusPENDING' %]
            [% ELSIF s.state == 0 %]
              [% SET s_status = 'statusOK' %]
            [% ELSIF s.state == 1 %]
              [% SET s_status = 'statusWARNING' %]
            [% ELSIF s.state == 2 %]
              [% SET s_status = 'statusCRITICAL' %]
            [% ELSIF s.state == 3 %]
              [% SET s_status = 'statusUNKNOWN' %]
            [% END %]
            <a href='extinfo.cgi?type=2&amp;host=[% h.name | uri %]&amp;service=[% s.description | uri %]' class='[% s_status %]'>[% s.display_name %]</a>
            [% IF loop.index > 0 && loop.index % 7 == 0 %]<br>[% END %]
            [% END %]
          </td>
          <td class='[% hostclass %]'>
            <a href='extinfo.cgi?type=1&amp;host=[% h.name | uri %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/detail.gif' border="0" alt='View Extended Information For This Host' title='View Extended Information For This Host' width="20" height="20"></a>
            [% IF h.notes_url_expanded %]
            <a href='[% h.notes_url_expanded %]' target='[% c.config.cgi_cfg.notes_url_target %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/notes.gif' border="0" width="20" height="20" alt='View Extra Host Notes' title='View Extra Host Notes'></a>
            [% END %]
            [% IF h.action_url_expanded %]
            <a href='[% h.action_url_expanded %]' target='[% c.config.cgi_cfg.action_url_target %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/[% action_icon(h, host_action_icon) %]' border="0" width="20" height="20" alt='Perform Extra Host Actions' title='Perform Extra Host Actions'></a>
            [% END %]
            <a href='status.cgi?host=[% h.name | uri %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/status2.gif' border="0" alt='View Service Details For This Host' title='View Service Details For This Host' width="20" height="20"></a>
            [% IF use_feature_statusmap %]
            <a href='statusmap.cgi?host=[% h.name | uri %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/status3.gif' border="0" alt='Locate Host On Map' title='Locate Host On Map' width="20" height="20"></a>
            [% END %]
          </td>
        </tr>
        [% END %]
      </table>
      [% END %]
    </div>

    <div align="center">[% PROCESS _pager.tt %]</div>

[% PROCESS _footer.tt %]
