Skip to content
Snippets Groups Projects
Commit 1b4af9fe authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add human friendly system name to health report

Relates to #20
parent 862c0216
No related branches found
No related tags found
No related merge requests found
...@@ -155,11 +155,13 @@ namespace ATxCommon ...@@ -155,11 +155,13 @@ namespace ATxCommon
/// Generate an overall system health report with free space, grace location status, etc. /// Generate an overall system health report with free space, grace location status, etc.
/// </summary> /// </summary>
/// <param name="storage">StorageStatus object used for space and grace reports.</param> /// <param name="storage">StorageStatus object used for space and grace reports.</param>
/// <param name="humanSystemName">A human-friendly name/description of the system.</param>
/// <returns>A multi-line string containing the details assembled in the report. These /// <returns>A multi-line string containing the details assembled in the report. These
/// comprise system uptime, free RAM, free storage space and current grace location status. /// comprise system uptime, free RAM, free storage space and current grace location status.
/// </returns> /// </returns>
public static string HealthReport(StorageStatus storage) { public static string HealthReport(StorageStatus storage, string humanSystemName="N/A") {
var report = "------ System health report ------\n\n" + var report = "------ System health report ------\n\n" +
$" - human name: {humanSystemName}\n" +
$" - hostname: {Environment.MachineName}\n" + $" - hostname: {Environment.MachineName}\n" +
$" - uptime: {TimeUtils.SecondsToHuman(Uptime(), false)}\n" + $" - uptime: {TimeUtils.SecondsToHuman(Uptime(), false)}\n" +
$" - free system memory: {GetFreeMemory()} MB" + "\n\n"; $" - free system memory: {GetFreeMemory()} MB" + "\n\n";
......
...@@ -408,7 +408,7 @@ namespace ATxService ...@@ -408,7 +408,7 @@ namespace ATxService
"\n------ Loaded configuration settings ------\n" + _config.Summary(); "\n------ Loaded configuration settings ------\n" + _config.Summary();
var health = SystemChecks.HealthReport(_storage); var health = SystemChecks.HealthReport(_storage, _config.HostAlias);
SendHealthReport(health); SendHealthReport(health);
msg += "\n" + health; msg += "\n" + health;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment