Beispiel #1
0
        public static HealthMonitoringService Create(IDnsServer dnsServer)
        {
            if (_healthMonitoringService is null)
            {
                _healthMonitoringService = new HealthMonitoringService(dnsServer);
            }

            return(_healthMonitoringService);
        }
Beispiel #2
0
        public EmailAlert(HealthMonitoringService service, dynamic jsonEmailAlert)
        {
            _service = service;

            _smtpClient           = new SmtpClientEx();
            _smtpClient.DnsClient = new DnsClientInternal(_service.DnsServer);

            Reload(jsonEmailAlert);
        }
Beispiel #3
0
        public AddressMonitoring(HealthMonitoringService service, IPAddress address, string healthCheck)
        {
            _service = service;
            _address = address;

            if (_service.HealthChecks.TryGetValue(healthCheck, out HealthCheck existingHealthCheck))
            {
                _healthMonitors.TryAdd(healthCheck, new HealthMonitor(_service.DnsServer, _address, existingHealthCheck));
            }
        }
Beispiel #4
0
        public Task InitializeAsync(IDnsServer dnsServer, string config)
        {
            if (_healthMonitor is null)
            {
                _healthMonitor = HealthMonitoringService.Create(dnsServer);
            }

            //let Address class initialize config

            return(Task.CompletedTask);
        }
Beispiel #5
0
        public Task InitializeAsync(IDnsServer dnsServer, string config)
        {
            if (_healthMonitor is null)
            {
                _healthMonitor = HealthMonitoringService.Create(dnsServer);
            }

            _healthMonitor.Initialize(JsonConvert.DeserializeObject(config));

            return(Task.CompletedTask);
        }
Beispiel #6
0
        public DomainMonitoring(HealthMonitoringService service, string domain, DnsResourceRecordType type, string healthCheck)
        {
            _service = service;
            _domain  = domain;
            _type    = type;

            if (_service.HealthChecks.TryGetValue(healthCheck, out HealthCheck existingHealthCheck))
            {
                _healthMonitors.TryAdd(healthCheck, new HealthMonitor(_service.DnsServer, domain, type, existingHealthCheck));
            }
        }
Beispiel #7
0
        public WebHook(HealthMonitoringService service, dynamic jsonWebHook)
        {
            _service = service;

            Reload(jsonWebHook);
        }
Beispiel #8
0
        public HealthCheck(HealthMonitoringService service, dynamic jsonHealthCheck)
        {
            _service = service;

            Reload(jsonHealthCheck);
        }