public void sendReply_cgibin_listall_cgi(MyHTTPServer socket, List<HTTPRequestData> getData, String cookie) throws Exception
	{
		List<String> reply = new ArrayList<String>();

		addHTTP200(reply, cookie);
		addPageHeader(reply, "");

		Object [] result = CoffeeSaint.loadNagiosData(null, -1, null);
		JavNag javNag = (JavNag)result[0];
		if (result[1] != null)
			reply.add("<B>Problem load: " + (String)result[1] + "</B><BR>");
                List<Problem> problems = CoffeeSaint.findProblems(javNag);
                coffeeSaint.learnProblemCount(problems.size());
		coffeeSaint.collectPerformanceData(javNag);
		coffeeSaint.collectLatencyData(javNag);

		reply.add("<TABLE>\n");
		reply.add("<TR><TD><B>Host</B></TD><TD><B>host status</B></TD><TD><B>Service</B></TD><TD><B>service status</B></TD></TR>\n");

		List<Host> hosts = javNag.getListOfHosts();
		int nPages = (hosts.size() + maxNHostsPerPage - 1) / maxNHostsPerPage;

		int page = 1;
		if (getData != null)
		{
			HTTPRequestData pageRecord = MyHTTPServer.findRecord(getData, "page");
			if (pageRecord != null)
			{
				page = Integer.valueOf(pageRecord.getData().trim());
			}
			if (page < 1)
				page = 1;
		}
		page--;
		if (page >= nPages)
			page = nPages;

		if (nPages > 1)
		{
			reply.add("Page: ");
			for(int pageNr=1; pageNr<=nPages; pageNr++)
			{
				if (pageNr == (page + 1))
					reply.add("" + pageNr + "&nbsp;");
				else
					reply.add("<A HREF=\"/cgi-bin/list-all.cgi?page=" + pageNr + "\">" + pageNr + "</A>&nbsp;");
			}
			reply.add("<BR>\n");
		}

		int pageOffset = page * maxNHostsPerPage;
		for(int index=pageOffset; index<Math.min(pageOffset + maxNHostsPerPage, hosts.size()); index++)
		{
			Host currentHost = hosts.get(index);

			String hostState = currentHost.getParameter("state_type").equals("1") ? currentHost.getParameter("current_state") : "0";
			String htmlHostStateColor = htmlColorString(coffeeSaint.stateToColor(hostState.equals("1") ? "2" : hostState, true));

			String host;
			if (coffeeSaint.havePerformanceData(currentHost.getHostName(), null))
			{
				String url = graphZoomInUrl(currentHost.getHostName(), null, null);
				host = "<A HREF=\"" + url + "\">" + abreviateString(currentHost.getHostName(), 16) + "</A>";
			}
			else
				host = currentHost.getHostName();

			reply.add("<TR><TD>" + host + "</TD><TD BGCOLOR=\"#" + htmlHostStateColor + "\">" + coffeeSaint.hostState(hostState) + "</TD>");

			boolean first = true;
			for(Service currentService : currentHost.getServices())
			{
				String serviceState = currentService.getParameter("state_type").equals("1") ? currentService.getParameter("current_state") : "0";
				String htmlServiceStateColor = htmlColorString(coffeeSaint.stateToColor(serviceState, true));

				String service;
				if (coffeeSaint.havePerformanceData(currentHost.getHostName(), currentService.getServiceName()))
				{
					String url = graphZoomInUrl(currentHost.getHostName(), currentService.getServiceName(), null);
					service = "<A HREF=\"" + url + "\">" + abreviateString(currentService.getServiceName(), 20) + "</A>";
				}
				else
					service = currentService.getServiceName();

				if (first)
				{
					first = false;
					reply.add("<TD>" + service + "</TD><TD BGCOLOR=\"#" + htmlServiceStateColor + "\">" + coffeeSaint.serviceState(serviceState) + "</TD></TR>\n");
				}
				else
				{
					reply.add("<TR><TD></TD><TD></TD><TD>" + currentService.getServiceName() + "</TD><TD BGCOLOR=\"#" + htmlServiceStateColor + "\">" + coffeeSaint.serviceState(serviceState) + "</TD></TR>\n");
				}
			}
		}
		reply.add("</TABLE>\n");

		addPageTail(reply, true);

		socket.sendReply(reply);
	}