Exemplo n.º 1
0
 public bool ConsolidationTask()
 {
     return(StartTask("Healthcheck consolidation",
                      () =>
     {
         HealthcheckAnalyzer hc = new HealthcheckAnalyzer();
         if (String.IsNullOrEmpty(FileOrDirectory))
         {
             FileOrDirectory = Directory.GetCurrentDirectory();
         }
         if (!Directory.Exists(FileOrDirectory))
         {
             WriteInRed("The directory " + FileOrDirectory + " doesn't exist");
             return;
         }
         HealthcheckDataCollection consolidation = HealthcheckDataHelper.LoadXmls(FileOrDirectory, FilterReportDate);
         if (consolidation.Count == 0)
         {
             WriteInRed("No report has been found. The program will stop");
             return;
         }
         HealthCheckReportConsolidation report = new HealthCheckReportConsolidation(consolidation);
         report.GenerateReportFile("ad_hc_summary.html");
         HealthCheckReportMapBuilder nodeAnalyzer = new HealthCheckReportMapBuilder(consolidation);
         nodeAnalyzer.Log = Console.WriteLine;
         nodeAnalyzer.GenerateReportFile("ad_hc_summary_full_node_map.html");
         nodeAnalyzer.FullNodeMap = false;
         nodeAnalyzer.CenterDomainForSimpliedGraph = CenterDomainForSimpliedGraph;
         nodeAnalyzer.GenerateReportFile("ad_hc_summary_simple_node_map.html");
     }
                      ));
 }
Exemplo n.º 2
0
 public bool GenerateDemoReportTask()
 {
     return(StartTask("Generating demo reports",
                      () =>
     {
         if (String.IsNullOrEmpty(FileOrDirectory))
         {
             FileOrDirectory = Directory.GetCurrentDirectory();
         }
         if (!Directory.Exists(FileOrDirectory))
         {
             WriteInRed("The directory " + FileOrDirectory + " doesn't exist");
             return;
         }
         string path = Path.Combine(FileOrDirectory, "demo");
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         HealthcheckDataCollection consolidation = HealthcheckDataHelper.LoadXmls(FileOrDirectory, FilterReportDate);
         if (consolidation.Count == 0)
         {
             WriteInRed("No report has been found. The program will stop");
             return;
         }
         consolidation = HealthcheckDataHelper.TransformReportsToDemo(consolidation);
         foreach (HealthcheckData data in consolidation)
         {
             string domain = data.DomainFQDN;
             HealthCheckReportSingle report = new HealthCheckReportSingle(data, License);
             string newfile = Path.Combine(path, "ad_hc_" + domain + ".html");
             string html = report.GenerateReportFile(newfile);
             newfile = Path.Combine(path, "ad_hc_" + domain + ".xml");
             data.Level = ExportLevel;
             string xml = DataHelper <HealthcheckData> .SaveAsXml(data, newfile, EncryptReport);
         }
     }
                      ));
 }