doctor: complete runtime check documentation sprint
Signed-off-by: master <>
This commit is contained in:
@@ -39,6 +39,11 @@ public abstract class DatabaseCheckBase : IDoctorCheck
|
||||
return !string.IsNullOrEmpty(connectionString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the runbook URL for the concrete check.
|
||||
/// </summary>
|
||||
protected abstract string RunbookUrl { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<DoctorCheckResult> RunAsync(DoctorPluginContext context, CancellationToken ct)
|
||||
{
|
||||
@@ -72,8 +77,9 @@ public abstract class DatabaseCheckBase : IDoctorCheck
|
||||
"Authentication failed",
|
||||
"Network connectivity issue")
|
||||
.WithRemediation(r => r
|
||||
.AddShellStep(1, "Test connection", "psql -h <host> -U <user> -d <database> -c 'SELECT 1'")
|
||||
.AddManualStep(2, "Check credentials", "Verify database username and password in configuration"))
|
||||
.AddShellStep(1, "Test connection", "psql \"Host=<host>;Port=5432;Database=<database>;Username=<user>;Password=<password>\" -c \"SELECT 1\"")
|
||||
.AddManualStep(2, "Check configuration", "Verify ConnectionStrings__DefaultConnection or Doctor__Plugins__Database__ConnectionString points to the intended PostgreSQL instance")
|
||||
.WithRunbookUrl(RunbookUrl))
|
||||
.WithVerification($"stella doctor --check {CheckId}")
|
||||
.Build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user