New: Option to send notification when a Health Check warning occurs

This commit is contained in:
Devin Buhl
2019-11-04 15:44:33 -05:00
committed by Qstick
parent e0b6bde525
commit 4e07e3bd68
26 changed files with 253 additions and 5 deletions

View File

@@ -70,6 +70,23 @@ namespace NzbDrone.Core.Notifications.Slack
_proxy.SendPayload(payload, Settings);
}
public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck)
{
var attachments = new List<Attachment>
{
new Attachment
{
Title = healthCheck.Source.Name,
Text = healthCheck.Message,
Color = healthCheck.Type == HealthCheck.HealthCheckResult.Warning ? "warning" : "danger"
}
};
var payload = CreatePayload("Health Issue", attachments);
_proxy.SendPayload(payload, Settings);
}
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();