public void sendReply_cgibin_performancedata_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);

		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;

		reply.add("<H1>Performance data</H1>\n");
		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/performance-data.cgi?page=" + pageNr + "\">" + pageNr + "</A>&nbsp;");
			}
			reply.add("<BR>\n");
		}
		reply.add("<TABLE WIDTH=\"100%\">\n");
		reply.add("<TR><TD><B>host</B></TD><TD><B>service</B></TD><TD><B>parameter</B></TD><TD><B>min</B></TD><TD><B>max</B></TD><TD><B>avg</B></TD><TD><B>std.dev.</B></TD><TD><B>samples</B></TD><TD><B>sparkline</B></TD></TR>\n");
		int pageOffset = page * maxNHostsPerPage;
		for(int index=pageOffset; index<Math.min(pageOffset + maxNHostsPerPage, hosts.size()); index++)
		{
			Host currentHost = hosts.get(index);

			List<DataSource> dataSources = coffeeSaint.getPerformanceData(currentHost.getHostName(), null);
			if (dataSources != null)
			{
				for(DataSource dataSource : dataSources)
				{
					DataInfo dataInfo = dataSource.getStats();

					String host = abreviateString(currentHost.getHostName(), 16);

					if (dataInfo != null)
					{
						String sparkCol = "<TD></TD>";
						if (coffeeSaint.havePerformanceData(currentHost.getHostName(), null))
						{
							String url = graphZoomInUrl(currentHost.getHostName(), null, dataSource.getDataSourceName());
							host = "<A HREF=\"" + url + "\">" + abreviateString(currentHost.getHostName(), 16) + "</A>";
							url = sparkLineUrl(currentHost.getHostName(), null, dataSource.getDataSourceName(), 100, 15, false);
							sparkCol = "<TD><IMG SRC=\"" + url + "\" BORDER=0></TD>";
						}

						String unit = dataSource.getUnit();
						reply.add("<TR><TD>" + host + "</TD><TD></TD><TD>" + abreviateString(dataSource.getDataSourceName(), 17) + "</TD><TD>" + formatValue(dataInfo.getMin()) + unit + "</TD><TD>" + formatValue(dataInfo.getMax()) + unit + "</TD><TD>" + formatValue(dataInfo.getAvg()) + unit + "</TD><TD>" + formatValue(dataInfo.getSd()) + unit + "</TD><TD>" + dataInfo.getN() + "</TD>" + sparkCol + "</TR>\n");
					}
					else
					{
						reply.add("<TR><TD>" + host + "</TD><TD></TD><TD>" + abreviateString(dataSource.getDataSourceName(), 17) + "</TD><TD COLSPAN=\"6\">No data measured yet.</TD></TR>\n");
					}
				}
			}
			for(Service currentService : currentHost.getServices())
			{
				dataSources = coffeeSaint.getPerformanceData(currentHost.getHostName(), currentService.getServiceName());
				if (dataSources != null)
				{
					for(DataSource dataSource : dataSources)
					{
						DataInfo dataInfo = dataSource.getStats();

						String service = abreviateString(currentService.getServiceName(), 20);

						if (dataInfo != null)
						{
							String sparkCol = "<TD></TD>";
							if (coffeeSaint.havePerformanceData(currentHost.getHostName(), currentService.getServiceName()))
							{
								String url = graphZoomInUrl(currentHost.getHostName(), currentService.getServiceName(), dataSource.getDataSourceName());
								service = "<A HREF=\"" + url + "\">" + abreviateString(currentService.getServiceName(), 20) + "</A>";
								url = sparkLineUrl(currentHost.getHostName(), currentService.getServiceName(), dataSource.getDataSourceName(), 100, 15, false);
								sparkCol = "<TD><IMG SRC=\"" + url + "\" BORDER=0></TD>";
							}

							String unit = dataSource.getUnit();
							reply.add("<TR><TD>" + abreviateString(currentHost.getHostName(), 16) + "</TD><TD>" + service + "</TD><TD>" + abreviateString(dataSource.getDataSourceName(), 17) + "</TD><TD>" + formatValue(dataInfo.getMin()) + unit + "</TD><TD>" + formatValue(dataInfo.getMax()) + unit + "</TD><TD>" + formatValue(dataInfo.getAvg()) + unit + "</TD><TD>" + formatValue(dataInfo.getSd()) + unit + "</TD><TD>" + dataInfo.getN() + "</TD>" + sparkCol + "</TR>\n");
						}
						else
						{
							reply.add("<TR><TD>" + abreviateString(currentHost.getHostName(), 16) + "</TD><TD>" + service + "</TD><TD>" + abreviateString(dataSource.getDataSourceName(), 17) + "</TD><TD COLSPAN=\"6\">No data measured yet.</TD></TR>\n");
						}
					}
				}
			}
		}
		reply.add("</TABLE>\n");

		addPageTail(reply, true);

		socket.sendReply(reply);
	}