private void RunResolveProblems(MonitoringData monitoringData, List <TroubleshooterCheck> checkList, List <TroubleshooterCheck> failedCheckList) { if (failedCheckList.Count == 0) { ExchangeServer exchangeServer = (ExchangeServer)base.Fields["ExchangeServer"]; monitoringData.Events.Add(new MonitoringEvent(AssistantTroubleshooterBase.EventSource, 5000, EventTypeEnumeration.Information, Strings.TSNoProblemsDetected(exchangeServer.Name))); using (List <TroubleshooterCheck> .Enumerator enumerator = checkList.GetEnumerator()) { while (enumerator.MoveNext()) { TroubleshooterCheck troubleshooterCheck = enumerator.Current; AssistantTroubleshooterBase assistantTroubleshooterBase = troubleshooterCheck as AssistantTroubleshooterBase; if (assistantTroubleshooterBase != null) { monitoringData.PerformanceCounters.Add(assistantTroubleshooterBase.GetCrashDumpCountPerformanceCounter()); break; } } return; } } if (this.ResolveProblems.IsPresent) { foreach (TroubleshooterCheck troubleshooterCheck2 in failedCheckList) { troubleshooterCheck2.Resolve(monitoringData); } } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(); base.InternalProcessRecord(); MonitoringData monitoringData = null; List <TroubleshooterCheck> checkList = this.GetCheckList(); List <TroubleshooterCheck> failedCheckList = TroubleshooterCheck.RunChecks(checkList, new TroubleshooterCheck.ContinueToNextCheck(TroubleshooterCheck.ShouldContinue), out monitoringData); this.RunResolveProblems(monitoringData, checkList, failedCheckList); base.WriteObject(monitoringData, true); TaskLogger.LogExit(); }
public static bool ShouldContinue(TroubleshooterCheck troubleshooterCheck, MonitoringData monitoringData, bool errorsReturned) { return(!errorsReturned); }