1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-19 21:46:43 -04:00

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

closes #3253
This commit is contained in:
Qstick
2019-08-07 21:45:29 -04:00
committed by Taloth Saldono
parent 7b68ce49d5
commit f2efebf7d9
29 changed files with 267 additions and 6 deletions
@@ -8,6 +8,7 @@ using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Processes;
using NzbDrone.Core.HealthCheck;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Validation;
@@ -125,6 +126,19 @@ namespace NzbDrone.Core.Notifications.CustomScript
ExecuteScript(environmentVariables);
}
public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck)
{
var environmentVariables = new StringDictionary();
environmentVariables.Add("Sonarr_EventType", "HealthIssue");
environmentVariables.Add("Sonarr_Health_Issue_Level", nameof(healthCheck.Type));
environmentVariables.Add("Sonarr_Health_Issue_Message", healthCheck.Message);
environmentVariables.Add("Sonarr_Health_Issue_Type", healthCheck.Source.Name);
environmentVariables.Add("Sonarr_Health_Issue_Wiki", healthCheck.WikiUrl.ToString() ?? string.Empty);
ExecuteScript(environmentVariables);
}
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();