Ejemplo n.º 1
0
        private void RuleTriggered(AdsRuleSetting setting)
        {
            if (!string.IsNullOrEmpty(setting.NegativeFilter))
            {
                try
                {
                    var regex = new Regex(setting.NegativeFilter);
                    if (regex.IsMatch(setting.AdsRuleName))
                    {
                        Log.To.Main.Add($"Ignoring rule due to filtering '{setting.AdsRuleName}' on machine {setting.MachineName}", LogLevel.Verbose);
                        return;
                    }
                }
                catch (Exception e)
                {
                    Log.To.Main.AddException($"Failed regex in Grouped Notifier worker with {setting.Key} and regex {setting.NegativeFilter}", e);
                }
            }
            //Notify("Sense node status Monitor has fired a warning", $"The Rule '{setting.AdsRuleName}' has triggered on machine {setting.MachineName}.");
            var msg = _messageModifier?.Invoke(setting) ?? $"The Rule '{setting.AdsRuleName}' has triggered on machine {setting.MachineName}.";

            _listOfWarnings.Add(msg);
        }
Ejemplo n.º 2
0
 private void ResetNotificationList(AdsRuleSetting setting)
 {
 }
 private string ModAlertString(AdsRuleSetting setting)
 {
     return((int)setting.AdsLastFired.Value == 2 ?
            $"Task taken too long: '{setting.AdsRuleName}' on '{setting.MachineName}'" :
            $"Task has failed reload '{setting.AdsRuleName}' on '{setting.MachineName}'");
 }
Ejemplo n.º 4
0
 private void RuleTriggered(AdsRuleSetting setting)
 {
     Notify("Memory Monitor has fired a warning", new List <string> {
         $"The Rule '{setting.AdsRuleName}' has triggered with high memory usage used on machine {setting.MachineName}."
     });
 }
Ejemplo n.º 5
0
 /// <summary>
 /// this vill send an ok signal if this monitor has given a ads fire message to the notifiers.
 /// </summary>
 protected void ResetNotification(AdsRuleSetting setting)
 {
     Notify("", new List <string>());
 }