public static Object [] loadNagiosData(Gui gui, int windowWidth, Graphics g) throws Exception
	{
		String exception = null;

		JavNag javNag = new JavNag();
		javNag.setUserAgent(version);
		javNag.setSocketTimeout(config.getSleepTime() * 1000);

		long startLoadTs = System.currentTimeMillis();

		int prevNHosts = -1;
		for(NagiosDataSource dataSource : config.getNagiosDataSources())
		{
			String logStr = "Loading data from: ", source = null;
			try {
				if (dataSource.getType() == NagiosDataSourceType.TCP)
				{
					source = dataSource.getHost() + " " + dataSource.getPort();
					logStr += source;
					drawLoadStatus(gui, windowWidth, g, "Load Nagios " + source);
					javNag.loadNagiosData(dataSource.getHost(), dataSource.getPort(), dataSource.getVersion(), false, dataSource.getPrettyName());
				}
				else if (dataSource.getType() == NagiosDataSourceType.ZTCP)
				{
					source = dataSource.getHost() + " " + dataSource.getPort();
					logStr += source;
					drawLoadStatus(gui, windowWidth, g, "zLoad Nagios " + source);
					System.out.println("zLoad Nagios " + source);
					javNag.loadNagiosData(dataSource.getHost(), dataSource.getPort(), dataSource.getVersion(), true, dataSource.getPrettyName());
				}
				else if (dataSource.getType() == NagiosDataSourceType.HTTP)
				{
					source = "" + dataSource.getURL();
					logStr += dataSource.getURL();
					drawLoadStatus(gui, windowWidth, g, "Load Nagios " + source);
					javNag.loadNagiosData(dataSource.getURL(), dataSource.getVersion(), dataSource.getUsername(), dataSource.getPassword(), config.getAllowHTTPCompression(), dataSource.getPrettyName());
				}
				else if (dataSource.getType() == NagiosDataSourceType.FILE)
				{
					source = dataSource.getFile();
					logStr += dataSource.getFile();
					drawLoadStatus(gui, windowWidth, g, "Load Nagios " + source);
					javNag.loadNagiosData(dataSource.getFile(), dataSource.getVersion(), dataSource.getPrettyName());
				}
				else if (dataSource.getType() == NagiosDataSourceType.LS)
				{
					source = dataSource.getHost() + " " + dataSource.getPort();
					logStr += source;
					drawLoadStatus(gui, windowWidth, g, "Load Nagios " + source);
					javNag.loadNagiosDataLiveStatus(dataSource.getHost(), dataSource.getPort(), dataSource.getPrettyName());
				}
				else
					throw new Exception("Unknown data-source type: " + dataSource.getType());

				if (javNag.getNumberOfHosts() == prevNHosts) {
					log.add(source + " did not return any hosts!");
					// FIXME on screen error or so?
				}
				prevNHosts = javNag.getNumberOfHosts();

				logStr += " - done.";
				log.add(logStr);
			}
			catch(Exception e) {
				exception = "Error loading Nagios data from " + source + ": " + e;
				log.add(exception);
			}
		}

		long endLoadTs = System.currentTimeMillis();

		double took = (double)(endLoadTs - startLoadTs) / 1000.0;
		log.add("Took " + took + "s to load status data");

		statisticsSemaphore.acquireUninterruptibly();
		statistics.addToTotalRefreshTime(took);
		statistics.addToNRefreshes(1);
		statisticsSemaphore.release();

		Object [] result = new Object[2];
		result[0] = javNag;
		result[1] = exception;

		return result;
	}