Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
1b4af9fe
Commit
1b4af9fe
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ATxCommon/SystemChecks.cs
+3
-1
3 additions, 1 deletion
ATxCommon/SystemChecks.cs
ATxService/AutoTx.cs
+1
-1
1 addition, 1 deletion
ATxService/AutoTx.cs
with
4 additions
and
2 deletions
ATxCommon/SystemChecks.cs
+
3
−
1
View file @
1b4af9fe
...
@@ -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"
;
...
...
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
1
−
1
View file @
1b4af9fe
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment