[% 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=summary'>View Status Summary For All Host Groups</a><br>
                  <a href='status.cgi?hostgroup=all&amp;style=grid'>View Status Grid For All Host Groups</a><br>
                [% ELSIF hostgroup != '' %]
                  <a href='status.cgi?hostgroup=all&amp;style=overview'>View Status Overview 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=summary'>View Status Summary For This Host Group</a><br>
                  <a href='status.cgi?hostgroup=[% hostgroup | uri %]&amp;style=grid'>View Status Grid 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=summary'>View Status Summary For All Service Groups</a><br>
                  <a href='status.cgi?servicegroup=all&amp;style=grid'>View Service Status Grid 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=summary'>View Status Summary For This Service Group</a><br>
                  <a href='status.cgi?servicegroup=[% servicegroup | uri %]&amp;style=grid'>View Service Status Grid For This Service Group</a><br>
                  <a href='status.cgi?servicegroup=all&amp;style=overview'>View Status Overview 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=summary'>View Status Summary For All Host Groups</a><br>
                  <a href='status.cgi?hostgroup=all&amp;style=grid'>View Status Grid 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_overview" %]
        </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 Overview For All Host Groups</div><br>
          [% ELSIF hostgroup != '' %]
          <div align="center" class='statusTitle'>Service Overview For Host Group '[% hostgroup %]'</div><br>
          [% ELSIF servicegroup == 'all' %]
          <div align="center" class='statusTitle'>Service Overview For All Service Groups</div><br>
          [% ELSIF servicegroup != '' %]
          <div align="center" class='statusTitle'>Service Overview For Service Group '[% servicegroup %]'</div><br>
          [% ELSE %]
          <div align="center" class='statusTitle'>Service Overview</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">

      <table border="0" cellpadding="10">
        <tr>
          [% FOR g IN data %]
          <td valign="top" align="center">
            [% 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 %]
            <div class='status'>
              <table border="1" class='status statusgroups'>
                <tr>
                  <th class='status'>Host</th>
                  <th class='status'>Status</th>
                  <th class='status'>Services</th>
                  <th class='status'>Actions</th>
                </tr>
                [% FOR hostname IN g.hosts.keys.sort %]
                [% SET h = g.hosts.$hostname %]
                [% host_name = h.name | uri %]
                [% 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 class='[% hostclass %]'>
                        <td class='[% hostclass %]'><a href='status.cgi?host=[% host_name %]&amp;style=detail' title='[% h.address %]'>[% h.display_name %]</a></td>

                        [% IF h.icon_image_expanded %]
                        <td class='[% hostclass %]' width="5"></td>
                        <td class='[% hostclass %]' align="right"><a href='extinfo.cgi?type=1&amp;host=[% host_name %]'><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></td>
                        [% END %]

                      </tr>
                    </table>
                  </td>
                  [% IF h.has_been_checked == 0 %]
                  <td class='statusHOSTPENDING'>PENDING</td>
                  [% ELSIF h.state == 0 %]
                  <td class='statusHOSTUP'>UP</td>
                  [% ELSIF h.state == 1 %]
                  <td class='statusHOSTDOWN'>DOWN</td>
                  [% ELSIF h.state == 2 %]
                  <td class='statusHOSTUNREACHABLE'>UNREACHABLE</td>
                  [% END %]
                  <td class='[% hostclass %]'>
                    <table border="0" width="100%">
                      [% grouplink = substyle _ 'group' %]
                      [% IF h.ok       %]<tr><td class='miniStatusOK'><a href='[%       uri_with(c, $grouplink => g.name, 'host' => host_name, 'style' => 'detail', 'servicestatustypes' => '2',  'hoststatustypes' => '15', 'serviceprops' => '0', 'hostprops' => '0' ) %]'>[% h.ok %] OK</a></td></tr>[% END %]
                      [% IF h.warning  %]<tr><td class='miniStatusWARNING'><a href='[%  uri_with(c, $grouplink => g.name, 'host' => host_name, 'style' => 'detail', 'servicestatustypes' => '4',  'hoststatustypes' => '15', 'serviceprops' => '0', 'hostprops' => '0' ) %]'>[% h.warning %] WARNING</a></td></tr>[% END %]
                      [% IF h.unknown  %]<tr><td class='miniStatusUNKNOWN'><a href='[%  uri_with(c, $grouplink => g.name, 'host' => host_name, 'style' => 'detail', 'servicestatustypes' => '8',  'hoststatustypes' => '15', 'serviceprops' => '0', 'hostprops' => '0' ) %]'>[% h.unknown %] UNKNOWN</a></td></tr>[% END %]
                      [% IF h.critical %]<tr><td class='miniStatusCRITICAL'><a href='[% uri_with(c, $grouplink => g.name, 'host' => host_name, 'style' => 'detail', 'servicestatustypes' => '16', 'hoststatustypes' => '15', 'serviceprops' => '0', 'hostprops' => '0' ) %]'>[% h.critical %] CRITICAL</a></td></tr>[% END %]
                      [% IF h.pending  %]<tr><td class='miniStatusPENDING'><a href='[%  uri_with(c, $grouplink => g.name, 'host' => host_name, 'style' => 'detail', 'servicestatustypes' => '1',  'hoststatustypes' => '15', 'serviceprops' => '0', 'hostprops' => '0' ) %]'>[% h.pending %] PENDING</a></td></tr>[% END %]
                    </table>
                    [% IF h.ok + h.warning + h.unknown + h.critical + h.pending == 0 %]
                    No matching services
                    [% END %]
                  </td>
                  <td class='[% hostclass %]'>
                    <a href='extinfo.cgi?type=1&amp;host=[% host_name %]'><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=[% host_name %]'><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=[% host_name %]'><img src='[% url_prefix %]thruk/themes/[% theme %]/images/status3.gif' border="0" width="20" height="20" alt='Locate Host On Map' title='Locate Host On Map'></a>
                    [% END %]
                  </td>
                </tr>
                [% END %]
              </table>
            </div>
          </td>
          [%# every 3rd group is in a new table row #%]
          [% IF loop.index % 3 == 2 and ! loop.last %]
            </tr>
            <tr>
          [% END %]
          [% END %]
        </tr>
      </table>
    </div>

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

[% PROCESS _footer.tt %]
