diff --git a/ATxCommon/SystemChecks.cs b/ATxCommon/SystemChecks.cs index c22b9c1f4b006370e9511069c46161ba5c0fb923..18abce0c7f6e97df5a5bf09f932f143bdd419d8b 100644 --- a/ATxCommon/SystemChecks.cs +++ b/ATxCommon/SystemChecks.cs @@ -103,41 +103,6 @@ namespace ATxCommon return -1; } - /// <summary> - /// Validate the WMI query methods work correctly and create a summary or warning message. - /// </summary> - /// <returns>A summary with current readings from WMI or a warning message.</returns> - public static string WmiSummary() { - var failed = new List<string>(); - var load = GetCpuUsage(); - var free = GetFreeMemory(); - var summary = $"CPU load: {load}\n" + - $"Free system memory: {Conv.MegabytesToString(free)}\n"; - Log.Warn(summary); - if (load == -1) { - failed.Add("CPU load"); - } - if (free == -1) { - failed.Add("free RAM"); - } - - if (failed.Count > 0) { - summary = "*******************************************************\n" + - "WARNING: Checking system parameters via WMI failed for:\n"; - foreach (var property in failed) { - summary += $" - {property}\n"; - } - - summary += "\n" + - "-------------------------------------------------------\n" + - "Limits configured for these properties will be IGNORED!\n" + - "-------------------------------------------------------\n\n"; - Log.Error(summary); - } - - return summary; - } - /// <summary> /// Get the free space of a drive in bytes. /// </summary> diff --git a/ATxService/AutoTx.cs b/ATxService/AutoTx.cs index 4af8b97945b6e659e70fb2abefc5a30907bf9c7a..c18bda08df10d9024a11061b301d5dd393604188 100644 --- a/ATxService/AutoTx.cs +++ b/ATxService/AutoTx.cs @@ -360,8 +360,7 @@ namespace ATxService msg += "\n------ Current system parameters ------\n" + - "Hostname: " + Environment.MachineName + "\n" + - SystemChecks.WmiSummary(); + $"Hostname: {Environment.MachineName}\n"; foreach (var driveToCheck in _config.SpaceMonitoring) { msg += "Free space on drive '" + driveToCheck.DriveName + "': " +