using System;
using System.Linq;
using Monithor.api;

namespace Monithor.cli {
	class Program {
		static void Main(string[] args) {
			Console.WriteLine("Initializing InfluxDB");
			DbProxy.Init();
			
			Console.WriteLine("Processing monitors...");
			DbProxy.ProcessMonitors();

			foreach (var statusPage in Config.StatusPages) {
				Console.WriteLine($"Processing status page {statusPage.Name} with route {statusPage.Route}");
				foreach (var monitor in statusPage.Monitors) {
					Console.WriteLine($"{monitor.displayName} is {monitor.monitor.Status} with last value {monitor.monitor.LastValue} and identifier {monitor.monitor.Identifier}");
				}
			}
		}
	}
}