Ejemplo n.º 1
0
        protected override void ValidateExpiration(CertificateInformation info)
        {
            TimeSpan t    = info.ValidTo.ToUniversalTime().Subtract(DateTime.UtcNow);
            string   text = string.Format("The following certificate is expiring within {0} day(s).", Math.Ceiling(t.TotalDays));

            if (t <= this.ErrorDaysBeforeExpiry)
            {
                TriggerHandler.Trigger("SSLCertificateErrorEvent", new object[]
                {
                    text,
                    info.ToString(),
                    info.ComponentOwner,
                    base.GetType().Name
                });
                return;
            }
            if (t <= this.WarningDaysBeforeExpiry)
            {
                TriggerHandler.Trigger("SSLCertificateWarningEvent", new object[]
                {
                    text,
                    info.ToString(),
                    info.ComponentOwner,
                    base.GetType().Name
                });
            }
        }
Ejemplo n.º 2
0
    public void trigger(TriggerData d)
    {
        switch (d.triggerType)
        {
        case Config.TriggerType.Action:
            CharactersAction action = d.triggerObj.GetComponent <CharactersAction>();
            action.trigger(Config.ActionTriggerCondition.TriggerByOthers);
            break;

        case Config.TriggerType.None:
            TriggerHandler handler = d.triggerObj.GetComponent <TriggerHandler>();
            handler.Trigger();
            break;
        }
    }
Ejemplo n.º 3
0
        public override void OnTimeUpdate(OnTimeUpdateSource source, OnTimeUpdateArgs args)
        {
            DateTime currentTime = args.Timestamp;

            this.tenantsOutOfSLA.RemoveAll((OABTenantInfo x) => x.LogLine.Timestamp.AddHours((double)this.monitoringInterval) < currentTime);
            foreach (OABTenantInfo oabtenantInfo in this.tenantsOutOfSLA)
            {
                if (oabtenantInfo.IsAlert(currentTime, this.noOfRequestsThreshold, base.TimeUpdatePeriod))
                {
                    TriggerHandler.Trigger(OABGenFailureLogAnalyzer.EventName.OABGenTenantOutOfSLA.ToString(), new object[]
                    {
                        oabtenantInfo.Organization,
                        this.lastTouchedTimeThreshold,
                        oabtenantInfo.LogLine.LastTouchedTime,
                        oabtenantInfo.LogLine.LastRequestedTime
                    });
                    oabtenantInfo.LastAlertTime = currentTime;
                }
            }
        }